A bash cheat sheet for developers who just want to get by.
Writing setup, CI and deployment flows means a bit of the old bash scripting.
Despit...
For further actions, you may consider blocking this person and/or reporting abuse
You should put spaces between the test brackets and the test conditions like
[ -f foo.txt ]
otherwise you'll get acommand not found
error.The environment variable one is over-complicated - you don't need the else, and you don't need to use
false
to ensure that the last command is run if you use a semicolon:Thanks I've updated it.
Good stuff! I feel like I know how to get around Bash, but I keep learning new tricks ever day, and I learned a few here, thanks!
Also, seeing that you have to end
case
block with the reverseesac
just makes me giggle!I don't like ask the user. The best answer is the one I will not ask.
BASH Docs are your best friend; especially peeping others legit scripts too of course.
Thanks for this insight too!