zrep 2.0 -- the bashening! #174
Replies: 6 comments 4 replies
-
There are a few things which do not work in bash:
- date computations (printf "%(%Y-%m-%d)T\n” yesterday) and the like cannot be done within bash, you are bound to use an external program like date of which there are several different versions, and hence is not portable
- pipes are handled differently, e.g. print "1 2" | read a b; print $a $b does not print 1 2 in bash but does in ksh
- arithmetic operations like $(( sin(1.57) )) are not supported in bash
- and a few other quirks I can think of right now
Kind regards
… On 22 Nov 2021, at 15:39, Philip Brown ***@***.***> wrote:
After a very long time... I have made the decision to change zrep to use bash!
This is for portability reasons. Getting a fully functional "proper" ksh is just too difficult these days, compared to me just converting the thing.
Currently it is on the new "zrep2.0" branch.
It appears to work for straight sync; however, I'm sure there are bugs lurking.
The one I'm currently stuck one: "zrep refresh" doesnt work, because somehow getting a lock via localhost isnt working.
The standard "kill -0 $PID" to check if $PID still is running, doesnt seem to work in the script.. yet seems to work fine when I run it by hand?? Any suggestions on that one would be welcome
But I encourage everyone to try it out. with caution :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#174>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADDUSNW3NXEC4VFKD4IG35DUNJIY7ANCNFSM5IRFJK7A>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
It does have integer arithmetic, but no float or trigonometric functions, I think.
And then, which version of bash ? Bash is improving but it is a moving target.
Personally I stay with ksh for scripting, all those goodies are in there for so long...
… On 22 Nov 2021, at 16:45, Philip Brown ***@***.***> wrote:
Actally. bash DOES apparently have $(( math)) now.
that would explain why sync works :)
https://bash.cyberciti.biz/guide/Perform_arithmetic_operations <https://bash.cyberciti.biz/guide/Perform_arithmetic_operations>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#174 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADDUSNTVDOY7OOXUDFN5VJ3UNJQQPANCNFSM5IRFJK7A>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Huh. I thought I'd posted an update in this thread, but mayhbe I did elsewhere. I think I have the normal push-sync working. So beta testers for that would be awesome. Its breaking for the pull mode, aka refresh. |
Beta Was this translation helpful? Give feedback.
-
Good update! So if that can be found, I think we will be pretty much there. |
Beta Was this translation helpful? Give feedback.
-
HI folks.... I THINK... THis may actually be DONE! To try out pure-bash version of zrep, you can grab from https://github.com/bolthole/zrep/blob/zrep2/zrep Please let me know how it works for you, and any bugs you may find... or if you dont find any at all :) |
Beta Was this translation helpful? Give feedback.
-
I think that it has had enough testing, that I made the official release! Announcement thread: -> #192 |
Beta Was this translation helpful? Give feedback.
-
After a very long time... I have made the decision to change zrep to use bash!
This is for portability reasons. Getting a fully functional "proper" ksh is just too difficult these days, compared to me just converting the thing.
Currently it is on the new "zrep2.0" branch.
It appears to work for straight sync; however, I'm sure there are bugs lurking.
The one I'm currently stuck one: "zrep refresh" doesnt work, because somehow getting a lock via localhost isnt working.
The standard "kill -0 $PID" to check if $PID still is running, doesnt seem to work in the script.. yet seems to work fine when I run it by hand?? Any suggestions on that one would be welcome
But I encourage everyone to try it out. with caution :)
Beta Was this translation helpful? Give feedback.
All reactions