Hi,
I am facing problem with "mail" utility on redhat linux.
If I use ~c in a file and use that file as imput to mail, the mail is not sent to the adrress after ~c. Instead ~c apears in the mail content itself.
$ mail a@mycompany.com < temp
$ cat temp
~c abc@mycompany.com
this is test mail
$
Now my mail content will be
~c abc@mycompany.com
this is test mail
Any help how I can use ~c using mail?
On solaris/HP I use mailx to achieve same functionality.
My sysadmin told that mailx is not availble in linux. When he installed mailx package, mail got installed.
thanks,
Ashish
Some mail programs, have a special option, like -l
or -~
to allow for tilde-escapes during non-interactive use. Check your man page..
mail abc@xyz.com <<EOF
~s Subject of this email
~c abc@xyz.com
This is the subject
EOF
This post has been hidden from public view by a moderator.
Yes he is the one we were discussing.. I made another observation here: http://www.unix.com/red-hat/181983-nis-server.html\#post302621347
Thanks itkamraj, scrutinizer for your reply.
However it still does not work for me.
I think my mail program is not recongizing ~s and ~c well.
In mail I am getting these characters with subject line and cc mail id as mail content.
Any pointers?
thanks
Ashish
---------- Post updated 04-12-12 at 03:42 PM ---------- Previous update was 04-11-12 at 03:54 PM ----------
The code put by itkamraj does not work for me.
Can somebody please try it on redhat linux and see it works.
I think I am missing something that my mail program is not recongnizing escape ~.
I tried setting it in .mailrc in my home directory but it didn't help.
Any help?
-Ashish
Anyone, could you please help?
I got this done using -I option will mail on linux.
-I option forces mail to act interactively.
The redhat linux I use is 5.6.