bash
bash
iterate through array
ARRAY=(a b c)
for a in "${ARRAY[*]}"; do echo "$a";doneaddress an array by index directly:
echo ${ARRAY[2]}output will be b
escape strings
echo "text with spaces & special characters" | bash -c 'printf "%q" "$(cat)"'; echowill output this: text\ with\ spaces\ \&\ special\ characters, now you can go ahead and use it in a script or something like that.
found this somewhere in here
disable history temporarily
because you don’t want credentials in your history, you know.
turn history off:
set +o historyturn it back on again:
set -o history