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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing arguements with spaces to script

Status
Not open for further replies.

maslett

Technical User
Mar 11, 2004
121
GB
Hi, I need to pass arguements to a ksh script but one of my arguements \may/ have a space or many spaces in it. How can I pass this arguement?

Thanks in advance.
 
That works fine when running from the command line but the arguements are coming from another program and it doesn't seem to like it. At least I know that "" is the right answer - I'll have a hack at the calling app.

Thanks.
 
please maslett, make a little effort
read manual, read manual, read manual
you need "aaa bbb", but your shell eats quotes...
so give it something to eat
try: theshell \""aaa bbb\""
and so on

:) guggach
 
In the calling prog I set the arguements to:
arg \""arg 2\""

Yet when I look in the log file after running it I get:
STEP: 2 VALUE: "[Arguement] = arg \arg 2\"

Looks like the shell is eating the "s and not the
The calling program is actually an IVR program (talking telephone jobbies) - maybe it doesn't like quotes in variables - it's a pretty crappy system. I'll find a work around.

Cheers.
 
Have you tried this ?
theshell '"aaa bb"'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The plot thickens! I tried the above and got:
STEP: 2 VALUE: "[Arguement] = arg 'arg 2'"

Looks like no double quotes allowed!
 
OK, try this:
Have you tried this ?
theshell "'aaa bb'"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Already tried it, same as before - no " only '

In the manual it states (about variable types):
Character: accepts as input all standard ASCII characters, including special characters and punctuation. The extended ASCII character set is not supported.

" is ASCII 34 so it *should* accept it.

I set a test variable to >"'"'"'test"'"'"'<

Guess what:
STEP: 2 VALUE: "[Test] = >'''test'''<"

What a bunch of lying Avaya $£%&ers !!!!

I should phone support up and "quote" the manual to them ;)
 

STEP: 2 VALUE: "[Arguement] = arg \arg 2\"

this is a printout,
no idea what the shell got
no idea what and how you are printing it
mybe you should post your sh-code

:) guggach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top