shell - unix linux shellscript programming printing input arguments containing multiple words -
i trying write shell script 1st 2nd , 3rd...n argument contains multiple words
mailing_list="abc@gmail.com xyz@gmail.com zed@gmail.com" echo $mailing_list mailing "error in job" " there records couldn't loaded db" " " $mailing_list
now want print mailing list in function can use send email
obviously no of mails in mailing list can change , forth .
kindly me issue.
p.s if use echo $#
gives me no of args 6 requirement print/get mailing list in function ..
enclose variable in quotes, since arguments separated spaces:
echo "$mailing_list" mailing "error in job" " there records couldn't loaded db" " " "$mailing_list"
just did "error in job"
. if had left quotes out, there have been 8 arguments.
Comments
Post a Comment