# use the string "is not null" operator
if [ -n $MY_ENV_VAR ]; then
echo "MY_ENV_VAR is defined as $MY_ENV_VAR"
else
echo "MY_ENV_VAR is not defined."
fi
# use the string "is null" operator
if [ -z $MY_ENV_VAR ]; then
echo "MY_ENV_VAR is not defined."
else
echo "MY_ENV_VAR is defined as $MY_ENV_VAR"
fi
compgen
is a built-in bash command that can list all the Linux commands
you can run.
compgen -b
- show all the Bash builtinscompgen -k
- show all the Bash keywordscompgen -c
- show all the available commandscompegn -a
- show all the aliasescompgen -A function
- show all the Bash functions
$ for f in `ls -1 /data/playlists/data*`; do basename $f; done