View Single Post
  #3   (View Single Post)  
Old 18th September 2017
ibara's Avatar
ibara ibara is offline
GNU gold linker
 
Join Date: Jan 2014
Posts: 564
Default

Quote:
Originally Posted by mefisto View Post
I decided to write a script based on Mark Rubel's work at http://www.mikerubel.org/computers/rsync_snapshots/. Since this were to be my first script, I decided to stand on the shoulders of giants, i.e., steal from others. This did not turn so well since most of the script use bash, which is absent from base OpenBSD.
No it doesn't. There are almost no bash-isms (or, at least, no bash-isms that weren't originally ksh-isms) in the original script.

Quote:
Originally Posted by mefisto View Post
Although I managed to find some tutorials on ksh to write the script, I wonder if this is the best way forward for portability reasons.
If you care about maximum portability, you would write your script entirely in POSIX sh.

Quote:
Originally Posted by mefisto View Post
1. What to do about scripts? Install bash for scripts? Or sacrifice portability and learn ksh?
Learn POSIX sh and only use that. Or
Code:
# pkg_add bash
and don't worry about it.

Quote:
Originally Posted by mefisto View Post
2. Where to store scripts and supporting files, e.g., configuration needed by the script?
Where ever you want? Your $HOME? /etc? Make an /opt directory yourself?
Reply With Quote