![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ksh: cmd output to input of another script | IMTheNachoMan | Shell Programming and Scripting | 2 | 04-27-2008 10:58 AM |
| log script input and output using tee ? | moseschrist | Shell Programming and Scripting | 0 | 11-12-2006 03:32 AM |
| Giving input to a script through a script | radhika03 | Shell Programming and Scripting | 7 | 08-18-2005 04:17 AM |
| command line paramaters | edog | UNIX for Dummies Questions & Answers | 1 | 01-15-2002 11:40 AM |
| Reading Input in a Script | alwayslearningunix | UNIX for Dummies Questions & Answers | 2 | 03-30-2001 01:48 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Script Input Paramaters
I'm trying to write a simple script to send e-mails using ksh on a Sun Solaris box.
The script is as follows: # Arguments: $1 = Command Type i.e. mailx etc # $2 = Subject # $3 = From # $4 = To # $5 = Mail File # # IF MAIL TYPE IS mailx THEN DO: # if [ "$1" = "mailx" ] then mailx -s $2 -r $3 $4 < $5 fi The problem is this. The subject input paramater i.e. $2 can be a full sentence i.e. "Test E-Mail". So how do I get a ksh script to read in a sentence and see it as a single input paramater and not multiple paramaters. This script is being run from within a 4GL program and the input paramaters are being passed in from DB fields. Is there a unix replace command I could use. I thought about passing the subject in as follows "Test_E-Mail" and the perhaps replacing the underscore "_" with a space " ". Is that possible? Cheers! |
|
||||
|
Hi, You can provide the subject within double quote ". Example: cat arg.ksh Code:
#!/bin/ksh echo $1 $2 $3 $4 $5 Code:
./arg.ksh mailx "Test Email" a@b.com d@e.com File Code:
Output : mailx Test Email a@b.com d@e.com File Does this answers your query. Thanks Nagarajan G |
|
||||
|
Thanks ...
Actually I had just figured that out myself. If I use single quotes from the 4GL and then change the mailx part of the script to take in literal double quotes it works fine.
Cheers again, Slainte. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|