mailx -s is showing an error


 
Thread Tools Search this Thread
Operating Systems Solaris mailx -s is showing an error
# 1  
Old 03-23-2008
mailx -s is showing an error

Error is like


/users/d12381/check.sh: mail_sysadmin@mycompany: not found

Plz help me to sort out this issue
# 2  
Old 03-23-2008
Including a fair amount of guesswork here, I would imagine that /users/d12381/check.sh is a shell script of yours which tries to invoke mailx -s, but also contains some sort of syntax error, which causes it to try to use an email address as a Unix command.

Compare:

bash$ nosuchcommand@all.sir
bash: nosuchcommand@all.sir: command not found

bash$ /bin/sh
$ nosuchcommand@all.sir
nosuchcommand@all.sir: not found
$
# 3  
Old 03-23-2008
Please help me -- mailx error

This is a script and at the end i want to send a a file to an email ID
But when i am checking the log file created by the script,it is showing that the corresponding mail is not found.
# 4  
Old 03-23-2008
This is a script and at the end i want to send a a file to an email ID
But when i am checking the log file created by the script,it is showing that the corresponding mail is not found.
# 5  
Old 03-23-2008
I'm sorry, but it's pretty impossible to guess what the problem is if you don't show the code.
# 6  
Old 03-23-2008
This is the script and crontab entry

#!/bin/ksh
echo "Mountpoint Utilisation " > file1
echo "################################" >> file1
df -h >> file1
echo " " >> file1
echo " " >> file1
echo "Total No of Processes" >> file1
echo "#################################">> file1
ps -ef |wc -l >> file1
cat file1 | mailx -s "Total Processes and Mountpoint Utilisation in `hostname`"
mail_sysadmin@mycompany.com </dev/null
exit
-----------------
-----------------------------------
Crontab entry is ...
48 15 * * * sh /users/d12381/check.sh > /users/d12381/check.log 2>&1
# 7  
Old 03-23-2008
You can't have a line wrap at the end of the "cat" command. Also, this is a Useless Use of Cat.

Code:
mailx -s "Total Processes and Mountpoint Utilization in `hostname`" \
  mail_sysadmin@mycompany.com <file1

A more elegant solution would avoid the use of a temporary file. Cron jobs have their output sent to the invoker by mail anyway so you could avoid the whole explicit invocation of mailx (unless mail_sysadmin is somebody else than yourself; but then see the MAILTO variable of Cron).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Showing error

if ; then rm -rf "${x}"_"${y}"_abc_pqr.dat error: `then' unmatchedCan anyone please help me in correcting it. Please use code tags next time for your code and data. Thanks (2 Replies)
Discussion started by: D_Sethi
2 Replies

2. Shell Programming and Scripting

Expect : exp_external not working / If not showing error

The big problem is that exp_internal isnt working... which makes it difficult to determine whats happening with the if statement. 1. why isnt exp_internal not working ? 2. Is there a better way to do the check of a file ? Im trying to find a "tighter" way to check that a file exists and has... (0 Replies)
Discussion started by: popeye
0 Replies

3. Shell Programming and Scripting

command showing error

Hi, I have an command which find the files modified within last 8 days and then after selecting the files from the location it make the tar format and send it to the specified destination ...now I want that this task to be automative ..that is it should happen after every 5 minutes ...for that... (3 Replies)
Discussion started by: NARESH SAXENA
3 Replies

4. Solaris

Error LED showing on E250

I've got an old E250 server where a front error LED is showing. I've read through the Sun docs (Sun Enterprise 250 Server Owner's Guide - Sun Microsystems) but it's only the 'General fault' LED (About the Status and Control Panel (Sun Enterprise 250 Server Owner's Guide) - Sun Microsystems)... (2 Replies)
Discussion started by: aussieos
2 Replies

5. Solaris

ultra 10 showing Date ERROR

ultra 10 showing date error. it showing date --:--:1967 frequently.sometimes it shows correct date. (3 Replies)
Discussion started by: yesquery
3 Replies

6. Solaris

fmthard showing error with prtvtoc

Hi all, I am trying to use the disk for mirror where in the mirror disk is of 160 gb and the rootdisk is of 80 gb. when i am trying to write the vtoc i am getting below error i tried the below command #prtvtoc /dev/rdsk/c0t0d0s0 |fmthard -s -/dev/rdsk/c0t2d0s0 and got below ... (26 Replies)
Discussion started by: kumarmani
26 Replies

7. HP-UX

Error alert keep showing at console

Hi, I would like to ask for your help. I tried to log in through console to my server HP-UX 10.20 but I keep receiving error message as below: Vxfs: mesg 001: vx_nospace -/dev/vg02/lvol6 file system full Vxfs: mesg 001: vx_nospace - /dev/vg02/lvol9 file system full How should I stop this... (4 Replies)
Discussion started by: yeazas
4 Replies

8. Solaris

tar -xvf is showing error

Hi, When i am trying to untar a file for installation its showing an error like tar -xvf te_agent__sparc.en_tar.gz tar: directory checksum error Please help me to solve this issue........... (10 Replies)
Discussion started by: Renjesh
10 Replies

9. UNIX for Dummies Questions & Answers

mailx error message : mailx: NUL changed to @

If I use the "Mail" link instead of the "mail" link to ../mailx I get this error. Mail so-n-so @whatever.com mailx: NUL changed to @ Unknown command: "postmaster" The email still goes through but i get the error. If I use "mail" it goes thru without the error. Any ideas?? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

10. Solaris

Interface not showing : Xview error

Hi I'm having a big trouble running a configuration tool (ftamtool) which uses xview on sunos 5.8, it refuses to start and says: XView error: could not load font 'FONT_FAMILY_SANS_SERIF... How to force the program to use installed fonts and where are fonts installed available to use ? ... (0 Replies)
Discussion started by: andryk
0 Replies
Login or Register to Ask a Question