|
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!
|