Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i pass all argument in $1 in shell script. I mean i don't want to use other $2,$3..$9 without that how can i pass all the argument in only $1. if it's possible than someone tell me how to achieve that.
Posted
Comments
ChauhanAjay 21-Aug-14 5:14am    
You mean to say you don't want multiple variable for passing the arguments. If this is the case then u could concatenate all the value with a separator and pass the argument and later split it on the separator and get the individual values.
DilipSutariya 21-Aug-14 5:21am    
yes i get it what you want to say but can i pass array as a argument in shell script?
ChauhanAjay 21-Aug-14 5:23am    
I have just given a general solution. I am not sure about passing array as a argument in shell script. Sorry.
DilipSutariya 21-Aug-14 5:28am    
Ok Thank you. @ChauhanAjay
Regards,
Dilip Sutariya
Richard MacCutchan 21-Aug-14 7:52am    
Just place all the items within double quotes like: "one two three ... etc".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900