mail command behave odd


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting mail command behave odd
# 1  
Old 02-19-2010
mail command behave odd

hi,

The following mail cmd executed successfully.
mailx -s 'subject' user@company.com < testfile.dat

However When i include this mail cmd in shell script it behave odd. Getting an error message mailx comand not found.
# 2  
Old 02-19-2010
I guess the problem would be the PATH variable, find the path of the mailx command
using whereis command.

Code:
whereis mailx

Then add that path in the PATH variable inside the script
Code:
 
PATH=<given path> 
mailx -s 'subject' user@company.com < testfile.dat

# 3  
Old 02-19-2010
mailx should be available from any user path.
Was the script created with a unix editor such as "vi" or "vim"?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How will these subshell commands behave?

Hello, I am firing off some scripts from a main script, cd B/ ./EV_B_m0-m200_hex1.sh & ./EV_B_m0-m200_hex2.sh & wait ...more It would be useful to put a bit of time between the two to clean up the output to the terminal. I think this would work, cd B/ ... (4 Replies)
Discussion started by: LMHmedchem
4 Replies

2. Homework & Coursework Questions

Creating a function that sends a mail using mail command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The function will be called m and it will allow you to send an email to someone using the mail command. The... (1 Reply)
Discussion started by: Drucian
1 Replies

3. UNIX for Advanced & Expert Users

Why do awk command line vars behave the way they do?

This came up a little in another thread. Can someone explain some why awk (I happen to use gawk) behaves as follows: $ cat file aaa $ awk 'BEGIN {print x}' x=1 $ awk x=1 'BEGIN {print x}' awk: fatal: cannot open file `BEGIN {print x}' for reading (No such file or directory) $ awk -v... (6 Replies)
Discussion started by: hanson44
6 Replies

4. Shell Programming and Scripting

Not able to send the mail using mail and mailx command

Hi All, I am trying to send a mail from linux server but could'nt able to send the mail. I tried the below syntax's so far but no luck. mail -s “Hello world” abc@xyz.com < /usr/g/txt.log cat "txt.log" | mailx -s "Hello world" abc@xyz.com mailx -s “Hello world” abc@xyz.com <... (2 Replies)
Discussion started by: scriptscript
2 Replies

5. UNIX for Dummies Questions & Answers

Uniq command behaving odd

My file has k s j v l k a s f l k s a d f j l a s (3 Replies)
Discussion started by: phoenix_nebula
3 Replies

6. UNIX for Advanced & Expert Users

Odd message from find command

Running the find command as: find /abc -follow -ls gives, for some files, the message, which I have never seen before: find: /abc/def/123.txt: No error Does it mean that find found the file with out error. If it found it without error then why did it not output the "ls" particulars as with... (2 Replies)
Discussion started by: twk
2 Replies

7. Shell Programming and Scripting

ksh - odd output from for command...

Help needed - I am sure there is something to do with tabs or white space that is killing me here.. I have a file that is generated from an oracle sql script - when I cat the file I see the below 601888725 14-AUG-08-10:20 3 601888726 14-AUG-08-10:37 ... (4 Replies)
Discussion started by: frustrated1
4 Replies

8. Shell Programming and Scripting

Why does IF loop behave differently in different shells

Hi , I have a script that compares two string and prints the larger string , This is an extract of a biggers script that i have. #! /bin/ksh DT_STRING_CMP=20081221223440 DT_STRING=20071221223440 if ; then echo "20081221223440" fi echo... (5 Replies)
Discussion started by: amit1_x
5 Replies

9. Shell Programming and Scripting

Why does IF loop behave differently in different shells

Hi , I have a script that compares two string and prints the larger string , This is an extract of a biggers script that i have. #! /bin/ksh DT_STRING_CMP=20081221223440 DT_STRING=20071221223440 if ; then echo "20081221223440" fi echo... (1 Reply)
Discussion started by: amit1_x
1 Replies

10. UNIX for Dummies Questions & Answers

how to make ssh to behave as rsh

hi frnds, how to make the ssh service to behave as rsh.as we know ssh asks for passwd whereas the rsh doesnt.so how can i perform the followin operation without being asked for passwd. lets say i want to run the command "ls" on "remote_terminal" $ssh remote_terminal ls the above should work... (1 Reply)
Discussion started by: mxms755
1 Replies
Login or Register to Ask a Question