4 comments:
Add a license?
Done.
Patch Set #7, Line 34: printf "${bred}TERMINATED${bend}\n"
Here's what I'm using in my scripts. This avoids all the shellcheck warnings. […]
Thank you for your alternative variant. However I have some doubts about its' portability - [[ ]] is a bash'ism if I recall it correctly - and I'm trying to write this script as portable as possible, to work at max number of different shells. At the same time, I like the idea of a custom function encapsulating the ${NC} etc., I would borrow it if will need more colored and different prints.
else
return 0
fi
Get rid of the else? This does the same thing. Same pattern below. […]
else is just in case I need to quickly insert a custom code to it, also like that both return lines are at the same offset.
-n?
From one hand, -n is indeed better (it's a good idea to avoid ! if possible), but from the other hand: it's easy to memorize that -z means zero, while -n is a bit ambiguous: it means "not null" but easy to confuse with "null" if you don't spend much time in bash for a while.
To view, visit change 33509. To unsubscribe, or for help writing mail filters, visit settings.