|
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..
|