1833800 Members
2557 Online
110063 Solutions
New Discussion

Re: ksh variable problem

 
SOLVED
Go to solution
Ratzie
Super Advisor

ksh variable problem

I have a ksh script that mailx a file.
The problem I am having is that the variable that I put for the subject only out put the first word.

MAIL=/bin/mailx
MAILTO=lhradowy@whatever.ca
SUBJECT="Database Archive Logs"

Here is my mail...
$MAIL -s $SUBJECT $MAILTO < $BACKUP_TEMP_LOG

When I get my mail, the subject only says...
Database


3 REPLIES 3
Pete Randall
Outstanding Contributor

Re: ksh variable problem

First, have you tried single quotes?

Second, here's an overly simplistic suggestion:

SUBJECT="DatabaseArchiveLogs"

-or-

SUBJECT="Database_Archive_Logs"


Pete

Pete
curt larson_1
Honored Contributor
Solution

Re: ksh variable problem

you'll need to put quotes around your subject:
$MAIL -s "$SUBJECT" $MAILTO < $BACKUP_TEMP_LOG
Rodney Hills
Honored Contributor

Re: ksh variable problem

Try-

$MAIL -s "$SUBJECT" $MAILTO <$BACKUP_TEMP_LOG

Putting double quotes around subject tells the shell to treat it as one parameter.

HTH

-- Rod Hills
There be dragons...