Have decided to publish the infamous Bash scripting conventions.
Here they are:
https://github.com/danfruehauf/Scripts/tree/master/bash_scripting_conventions
Please, comment, challenge and help me modify it. I’m very open for feedback.
Tags: Bash, Conventions, Linux, programming, script, Scripting
January 28, 2013 at 9:50 pm |
Be warned, using `dialog’ may be dangerous. It does not work when you have screen without defined dimension. It emits the the diagnostic:
“libgpm: zero screen dimension, assuming 80×25.”
and then loops forever.
Something like: echo -e “\n\n\n\t some message\n\n\n”
read ANS < /dev/tty # use of /dev/tty for interactive ONLY
case $ANS in
[Yy]* ) Yes action
[Nn]* ) No action
* ) error message
esac
will work on any terminal/screen
January 29, 2013 at 12:53 am |
First of all Ehud, thank you for the insightful reply.
It sounds also like something that should be fixed in `dialog`. I do indeed suggest to use dialog, but what I actually mean is that I encourage people to use proper UIs rather than complex command line arguments and/or vague environment variables.
Comment taken, I’ll change it soon to something a bit more clear about it. Thanks!