#! /bin/bash
firstArg=$1
default_IFS=”$IFS”
IFS=”,”
allArg=($firstArg)
IFS=”$defalut_IFS”
for eachArg in ${allArg[@]}
do
echo $eachArg
done
note: it is used to pass arg, arg, arg with $1 into array allArg and use it later.
#! /bin/bash
firstArg=$1
default_IFS=”$IFS”
IFS=”,”
allArg=($firstArg)
IFS=”$defalut_IFS”
for eachArg in ${allArg[@]}
do
echo $eachArg
done
note: it is used to pass arg, arg, arg with $1 into array allArg and use it later.