Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix string parameter problem - please reply

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi All,

I have a small problem in passing a string parameter.

Program: xx

Display()
{
echo $1
echo $2
echo $3
}

xx "sample param" 2 3

Result :

I want the program to display the whole string "sample param" for echo $1.
Now this is taken as 2 parameters


Thanks in advance


Regards

Jags


 
Could you please post more of this programm? Is it a shell script? Why use a subfunction? regards
chenn
 
Yes this is a shell script and i am using a predefined function in Oracle Applications.
Since the parameters are passed while executing the program are seperated by a space, i am unable to pass a string parameter "General Ledger" as one parameters
instead these are recognised as parameter 1 & Paramter 2.

Is there any special characters to enclosed parameters with more than one word ?


Help will be much appreciated.

Thanks a lot.

Reg

Jags
 
Jags,

Have you tried using single quotes?

xx 'sample param' 2 3

Mike
michael.j.lacey@ntlworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top