Sponsored Content
Top Forums Shell Programming and Scripting shell script not sending mail Post 302630571 by Pandee on Thursday 26th of April 2012 03:01:27 AM
Old 04-26-2012
HI Methyl, Thank you for that. it worked.

But the output is not a aligned one.

Code:
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c1t0d0s0      2.9G   2.3G   497M    83%    /
/proc                    0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
fd                       0K     0K     0K     0%    /dev/fd
/dev/dsk/c1t0d0s3      3.8G   2.2G   1.6G    57%    /var
swap                    14G   176K    14G     1%    /var/run
swap                    15G   981M    14G     7%    /tmp
/dev/dsk/c5t600C0FF00000000000441C4672DDFB00d0s0    33G    30G   3.2G    91%    /u05
/dev/dsk/c5t600C0FF00000000000441C167EE03F00d0s1    33G    31G   1.6G    95%    /u04
/dev/dsk/c5t600C0FF00000000000441C167EE03F00d0s0    33G    15G    18G    45%    /u03
/dev/md/dsk/d0          33G    24G   9.5G    72%    /app
/dev/dsk/c5t600C0FF00000000000441C3EB9BADC00d0s1    33G    29G   4.2G    88%    /u02
/dev/dsk/c5t600C0FF00000000000441C3EB9BADC00d0s0    33G    31G   1.6G    96%    /u01
/dev/dsk/c5t600C0FF00000000000441C6101145502d0s0   134G   126G   7.0G    95%    /u08
/dev/dsk/c5t600C0FF00000000000441C6101145500d0s0   134G   122G    12G    92%    /u10
/dev/dsk/c5t600C0FF00000000000441C6101145501d0s0   134G   111G    22G    84%    /u09
/dev/dsk/c5t600C0FF00000000000441C55A9336D01d0s0   134G   130G   2.9G    98%    /u07
/dev/dsk/c5t600C0FF00000000000441C55A9336D00d0s0   134G   123G    10G    93%    /u06

Could you help?

My script:

Code:
#!/bin/bash
_servers=xxx
_out="/tmp/output.$$"
_email="am@here.com"
_sub="Disk Space Report $(date)"
##_ssh=/usr/bin/ssh
_mailx=/usr/bin/mail
>$_out
for s in $_servers
do
     df -h >>$_out
done
$_mailx "${_sub}" $_email <$_out


Moderator's Comments:
Mod Comment Link: How to use [code] tags
 

10 More Discussions You Might Find Interesting

1. HP-UX

sending mail from a script

Hi I want to send a mail (to my id like abc@xyz.com) from a shell script running on HP Ux. Would like to include text from a file or include the file as attachment, either ways. Thanks Sidhu (6 Replies)
Discussion started by: Amardeep
6 Replies

2. Shell Programming and Scripting

sending a mail using shell script

Please help me in writing the script for sending an attachment through email.(For example my text file name is :abc.txt and it is in directory d:/abc) (1 Reply)
Discussion started by: anitha126
1 Replies

3. Shell Programming and Scripting

Shell script for sending automatic email to personal mail id

hi guys, I need a shell script to send mail automatically to my personal mail id like xxxx@hotmail.com but while experimenting with "mail" command I faced following problems. cat text1.txt | mail -s 'test mail' xxxx@hotmail.com command successfully executed but while checking for... (4 Replies)
Discussion started by: rrd1986
4 Replies

4. Linux

Memory monitoring and sending alert mail to users in network using shell script

i m workiing on a shell script which may monitors network memory and send alert to user if it increase a threshold (1 Reply)
Discussion started by: navdeep5673
1 Replies

5. Shell Programming and Scripting

Reading a file and sending mail by shell scripting?

hi I need help urgently...i need to write a shell script which can solve the following problem....its urgent plz help me out coz m totally newbie in shell scripting.... the problem is: Suppose I have a folder called logs. whenever some error occurs some correspondence error file is generated. I... (4 Replies)
Discussion started by: sukhdip
4 Replies

6. Shell Programming and Scripting

Shell script for creating log file and sending mail?

Hi , I am trying to create shell script which will help me to compare file name in two folder. There is a multiple file store in 2 folder.I want to compare that with the name. If all the file are same then send a mail that "all date is same" if not then create one log file which contain... (4 Replies)
Discussion started by: san_dy123
4 Replies

7. Shell Programming and Scripting

Sending mail from shell script

Hello All, I m trying to send mail from my unix script, I have used the below command mailx -s 'hi' email address < temp.txt It is not giving me any error,but I couldn't receive the mail Can you please help me. Many Thanks, Pragyan (6 Replies)
Discussion started by: prarat
6 Replies

8. Shell Programming and Scripting

Sending Mail via shell script

I am in need of a script that will send out emails while going through a NAT. What I have that works is as follows: display_remote_IP | sort | uniq | while read i do FOUND=0 for IP in `echo $ACCEPTABLEIP` do if ; then FOUND=1... (2 Replies)
Discussion started by: ldapguy
2 Replies

9. Shell Programming and Scripting

Configuring smtp settings and then sending the mail through shell script

I have make an menu in which first option is to start and second is to stop the services echo "Please enter the appropriate choice for doing the operations" echo " 1) STOP Services 2) START Services case $choice in 1) ... (1 Reply)
Discussion started by: punpun66
1 Replies

10. Shell Programming and Scripting

A shell script for checking the last image and sending it in attachment to mail

Hello every one. I use mutt : "mpack -s "Test" /home/pi/Pictures/2018-10-05_23_10_40.jpg my_email_addres " to send me a particular picture with the name of the data+jpg in a pictures folder, but this folder I use it for a timelapse proyect with more pictures , and what I need is... (2 Replies)
Discussion started by: maxbcn
2 Replies
mkdevmaps(1M)						  System Administration Commands					     mkdevmaps(1M)

NAME
mkdevmaps - make device_maps entries SYNOPSIS
/usr/sbin/mkdevmaps DESCRIPTION
The mkdevmaps command writes to standard out a set of device_maps(4) entries describing the system's frame buffer, audio, and removable media devices. The mkdevmaps command is used by the init.d(4) scripts to create or update the /etc/security/device_maps file. Entries are generated based on the device special files found in /dev. For the different categories of devices, the mkdevmaps command checks for the following files under /dev: audio /dev/audio, /dev/audioctl, /dev/sound/... tape /dev/rst*, /dev/nrst*, /dev/rmt/... floppy /dev/diskette, /dev/fd*, /dev/rdiskette, /dev/rfd* removable disk /dev/dsk/c0t?d0s?, /dev/rdsk/c0t?d0s? frame buffer /dev/fb ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Obsolete | +-----------------------------+-----------------------------+ SEE ALSO
allocate(1), bsmconv(1M), attributes(5) NOTES
mkdevmaps might not be supported in a future release of the Solaris operating system. SunOS 5.10 8 Oct 2003 mkdevmaps(1M)
All times are GMT -4. The time now is 01:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy