Sponsored Content
Top Forums Shell Programming and Scripting Would like to see how others would do this... Post 302120483 by aigles on Wednesday 6th of June 2007 04:11:13 PM
Old 06-06-2007
Sorry, a line is missing in my script (read statement) :
Code:
#!/usr/bin/ksh

usage=50
time_limit=3

sed  -n 's/.*\([0-9]\+\)%.*\([0-9][0-9]\):[0-9][0-9]:[0-9][0-9].*/\1 \2/;T;p' out.txt | \
read percentage hours

echo "${percentage}% ${hours}h"

if [[ $percentage -gt $usage ]] ;then
   echo "Disk usage beyond $usage%"
   #send mail
fi

if [[ $hours -gt $time_limit ]] ;then
   echo "Time limit beyond $time_limit hours"
   #send mail
fi

Quote:
+ [[ -gt 3 ]]
./test.sh: [[: not found
The script must be executed under ksh or bash (in that case modify first line).

Jean-Pierre.
 
All times are GMT -4. The time now is 10:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy