query in using Double Quotes

Hi

i am referring a book for understanding the Double Quotes
book suggest for the below code

code 

echo "$USER owes <-$1250.**>; [ as of (�date +%m/%d�) ]"

 the o/p is

Fred owes <-250.**>; [ as of (12/21) ]

however when i ran the same command i got below

 o/p

iscpadm owes <-250.**>; [ as of (date +%m/%d) ]

need to know why i am not getting the o/p for date part.

using OS AIX
shell is ksh

You are using the wrong quotes. use ` for calculations :slight_smile:

and here

 $USER owes <-$1250.**>; 

the system understands $1 as the 1st parameter being passed to the script. so you have to escape $ by using \ :slight_smile:

Hope this helps

one more thing
below code show output

 echo $USER

o/p is below

iscpadm

however the below code does not show anything why ?

echo $date

o/p for this is blank

really confuse

$date is not an environment variable. But $USER is not like that :slight_smile:

one more query

when i am using blow code

$ mail -s Meeting tomorrow khare < pp
$ /home/guest/khare/dead.letter... Saved message in /home/guest/khare/dead.letter

i can see the a mail send to the user but i can also see that tomorrow is also coming in receiver part . see the o/p below

From khare Mon Jul 16 11:56:15 2012
Return-Path: <khare>
Received: (from khare@localhost)
        by m-net.arbornet.org (8.14.5/8.14.5/Submit) id q6GFuFnO078136;
        Mon, 16 Jul 2012 11:56:15 -0400 (EDT)
        (envelope-from khare)
Date: Mon, 16 Jul 2012 11:56:15 -0400 (EDT)
From: vaibhav khare <khare>
Message-Id: <201207161556.q6GFuFnO078136@m-net.arbornet.org>
To: khare, tomorrow
Subject: Meeting

asdfasdfghgjh
qwer
zxcc

$    

now as i want to add subject as a meeting tomorrow.
for this i am using the below code but it does not show any o/p return to the dollar prompt

$ mail -s Meeting\ tomorrow khare < pp
$  

don't know why this is happening .

you have to use like this

 mail -s "Meeting Tomorrow" khare@host.com < pp 

Hope this helps :wink:

this also not working
please see below

$ mail -s "Meeting Tomorrow" khare@host.com < pp
$ 

This should work.... i have tried this and this is working fine......

did u just use

 mail -s "Meeting Tomorrow" khare@host.com < pp 

or

 mail -s "Subject Line" mail_address < file