re: Shellscripting: Conditional Execution VIEW POST

VIEW FULL DISCUSSION
 

I really enjoy using conditions in one-liners with shell:

# if file exists, source it
[ -f $HOME/.env-local ] && source $HOME/.env-local

# if directory doesn't exist, create it
[ -d ./test ] || mkdir ./test
code of conduct - report abuse