Archives for: March 2011, 17
Bash: Loop a comma separated list
March 17th, 2011Just perfect!
######VARIABLE DEFINITIONS#######
LIST=1,2,3,4,5
#################################
# Add a trailing comma to the list variable
LOOPVAR=${LIST},
# Loop as long as there is a comma in the variable
while echo $LOOPVAR | grep \,… more »