Usually, when I use a for loop in Bash, I do something like:
for USERNAME in $USERNAME_LIST
I found out today that you can also call a for loop without the "in" parameter and it will default to getting the input parameters that are passed to your script in the first place. So, if you want to be able to run your script as:
./my_script.sh username1 username2 username3
each of those usernames can be processed with a for like like:
for USERNAME
do
echo $USERNAME #Just echo it back out for debugging purposes
done
Common knowledge, I'm sure, but it's new to me and came in super handy today.