The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 08-23-2007
sriram003 sriram003 is offline
Registered User
 

Join Date: Mar 2007
Posts: 27
Can you suggest what is the syntax I am missing ?

bash-2.03$ ./new.sh
awk: syntax error near line 5
awk: illegal statement near line 5
./new.sh: line 8: 11058 Broken Pipe df -k
11059 Exit 2 | awk 'int($5) > 95{
subject = $1 " More than 95% disk usage "
email = "email@test.com"
cmd = "mailx -s \"" subject "\" " email
cmd | getline #or system(cmd)
}
'

====================================
bash-2.03$ cat new.sh (the script)
====================================
1
2 df -k | awk 'int($5) > 95{
3 subject = $1 " More than 95% disk usage "
4 email = "email@test.com"
5 cmd = "mailx -s \"" subject "\" " email
6 cmd | getline #or system(cmd)
7 }
8 '
====================================
bash-2.03$

Last edited by sriram003; 08-23-2007 at 06:55 AM..
Reply With Quote