You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loop through all files matching a filename pattern (access_log*) in the current directory and execute a command against each
forfilein access_log*;do cat $file| grep GET ;done
for loop [@] vs [*] vs without
my_array=(foo bar)
foriin"${my_array[@]}";doecho"$i";done# treat each element as a seperate string# foo# barforiin"${my_array[*]}";doecho"$i";done# gather all elements into a single string# foo barforiin"${my_array}";doecho"$i";done# only use first element# foo