Computing.Net > Forums > Unix > passing paramters with spaces

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

passing paramters with spaces

Reply to Message Icon

Name: jarice1978
Date: July 22, 2004 at 08:38:17 Pacific
OS: Unix
CPU/Ram: not sure
Comment:

I am trying to pass variables from a korn script to an oracle stored procedure that sends email. However when I pass the subject or the body of the email to the sql script that calls the procedure, each word of the subject or the body are treated as a seperate parameter. I have tried to surround with double quotes, single quotes, brackets, etc...

Here is an example:

executing sql script:

nohup sqlplus -s $UID_PWD @run_mail.sql $sender $receiver $subject $body


where subject = Test email 1
and body = this is a test email


The sql script basically just calls the stored procedure like this ...

execute run_mail('&1','&2','&3','&4')


When I run this the subject gets treated as 3 parameters instead of 1 bcause it contains 3 words. The body is treated as 5 paramters because there are 5 words.


Any idea how I can send a pramter consisting of multiple words and spaces to another script or Oracle process?


Any help would be appreciated!

Thanks,

Joe



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: July 22, 2004 at 11:12:24 Pacific
Reply:

Joe:

I'm not an Oracle person, but sometimes the shell eats the double quotes. Have you tried something like:

nohup sqlplus -s $UID_PWD @run_mail.sql $sender ""$receiver $subject $body""

where the last 3 vars are treated as one argument.

Or perhaps you might have to escape the inner quotes:

nohup sqlplus -s $UID_PWD @run_mail.sql $sender "\"$receiver $subject $body\""

Regards,

Nails


0

Response Number 2
Name: jarice1978
Date: July 22, 2004 at 13:45:56 Pacific
Reply:

Thanks fro the input. Actually I figured out that using the escape \ works when setting up the variables. However there looks like there is a limit on the amount of characters you can pass as an argument. So passing a large message body to an email is not going to work.

It looks like I will be able to do it another way though. I am using mailx within unix. Gets a little complicated though when trying to attach files... I will post when I figure it out.


Joe


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: passing paramters with spaces

Replace leading zeroes with spaces www.computing.net/answers/unix/replace-leading-zeroes-with-spaces/8157.html

Deleting a file(Name) with spaces www.computing.net/answers/unix/deleting-a-filename-with-spaces/8199.html

handling dir. with spaces with ls www.computing.net/answers/unix/handling-dir-with-spaces-with-ls/6801.html