bash 4.x is pretty good. You can do all sorts of fun things. Esp. with bash built-ins.
Lately ... I've been trying to make as many one line if statements as possible and use drop down logic for all practical purposes...too bad I can't do this with for & while loops.
You can also use this in aliases functions too, which makes setting up environments a snap...
mytag="Great big stuff"
[[ "${mytag}" == *"stuff"* ]] && { echo -en "${mytag/stuff/COOKIES}"; echo -en " are tasty\n"; sleep 5; } || { echo "Blech. You don't like cookies!"; [[ ! ${someothervar} ]] && echo "hello world."; }
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think you stole
[[ ${DEBUG} ]]
from me....bash 4.x is pretty good. You can do all sorts of fun things. Esp. with bash built-ins.
Lately ... I've been trying to make as many one line if statements as possible and use drop down logic for all practical purposes...too bad I can't do this with for & while loops.
You can also use this in aliases functions too, which makes setting up environments a snap...