Mailx command not working in the script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mailx command not working in the script
# 1  
Old 10-30-2012
Mailx command not working in the script

when i am using Mailx command from AIX box, i am getting the following errors :

uuencode: not found.
mailx: not found.

but when i executed the mailx command as shown below it worked
Code:
cat /etc/hosts | mailx -v -s "test email" user@server.com


It works fine in the production server.

Is there any property setting that i need to change in the other server?

Please advise.

Thanks

Last edited by Franklin52; 10-30-2012 at 07:12 AM.. Reason: Please use code tags for data and code samples
# 2  
Old 10-30-2012
Quote:
Originally Posted by pyaranoid
uuencode: not found.
mailx: not found.
I think you don't have those commands at your box.
You have to install it in your local box.

Quote:
Originally Posted by pyaranoid
w
It works fine in the production server.
It work's in production doesn't mean that it should work on your local also.
# 3  
Old 10-30-2012
Did you check the PATH environment variable in your script and in your interactive login session?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies

2. UNIX for Dummies Questions & Answers

Linux - mailx - attachment - via script/command

Hi I am trying to send an email using mailx with an attachment but without using uuencode. as per man page we can use -a option. I tried below command mailx -s "test" -a "/home/test/1.txt" "abc@gmail.com" but it waits for more input and i had to press ControlD which in turns print... (0 Replies)
Discussion started by: reldb
0 Replies

3. UNIX for Dummies Questions & Answers

Mailx command in unix shell script, its throwing below error

How to use Mailx command in unix shell script, its throwing below error #!/bin/ksh let x=3 If ; then mailx -s “ $x is greater than 2” example@gmail.com << EOF This is the message body EOF fi its throwing error as syntax error at EOF... (10 Replies)
Discussion started by: only4satish
10 Replies

4. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

5. Shell Programming and Scripting

mailx is not working

i have a file.i want to get that file to my mail.mail services are running.but still i didn't receive the mail. i have used this command. mailx -s file1 muraliinfy04@gmail.com < file2.txt.can anybody help me.it's urgent.I am new to unix. actually file1 i have directed to a file2.txt (8 Replies)
Discussion started by: muraliinfy04
8 Replies

6. Shell Programming and Scripting

Mailx: How to send a attachment using mailx command

Hi All, Can anyone please provide the command for sending an mail with attachment using mailx command. Thanks in Advance :) Regards, Siram. (3 Replies)
Discussion started by: Sriram.Vedula53
3 Replies

7. Shell Programming and Scripting

mailx not working

Hi All, I am strugging with mailx. I have a shell script which triggers mail when executed. I have mailx utility installed in system under /usr/bin/mailx but still when that script executes i am not getting mails..any idea why strange behaviour..? Tha:(nks in advance Usha (2 Replies)
Discussion started by: usha rao
2 Replies

8. UNIX for Dummies Questions & Answers

Mailx command not working

HI, I am sending a html attachment with the help of mailx and uuencode command ..but it is not working properly.. :confused: Following are the commands i tried out. parmdir=/opt/dwqa1/TEST/status_test uuencode $parmdir/some.html $parmdir/some.html | mailx -s TEST ajoshi@yahoo.com But in... (5 Replies)
Discussion started by: Amey Joshi
5 Replies

9. Solaris

mailx is not working.......

Hi All, I am working with solaris 5.9 servers.After some patch installation my mailx is not working in the server.I am using IBM Lotus Notes. Please help me to solve this issue (4 Replies)
Discussion started by: Renjesh
4 Replies

10. Shell Programming and Scripting

How to use mail,mailx command in Shell Script ?

Hi.. How can i use mailx,mail command in Shell Script. Suppose i gave a condition that x value is above 25 send a mail alert to abc@rediffmail.com. How can i do this? Regards Sollin (16 Replies)
Discussion started by: sollin
16 Replies
Login or Register to Ask a Question