
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlug] bash question
- Date: Mon, 17 Feb 2003 21:06:15 +0900
- From: Jean-Christian Imbeault <jc@example.com>
- Subject: [tlug] bash question
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
I can't seem to find the proper bash syntax for this simple thing.
#!/bin/sh
procs=`ps -aux | wc -l`
if ($procs > 400) then
echo "You have more than 400 procs running"
fi
If I run this I get:
# ./t.sh
./t.sh: 468: command not found
$procs is being interpreted as a command instead of an argument ... what
is the proper bash syntax to get a comparison done?
I've also tried:
if [ $proc -gt 400 ] then
echo "You have more than 400 procs running"
fi
but that throws a:
./t.sh: line 5: syntax error near unexpected token `fi'
./t.sh: line 5: `fi'
Thanks,
Jc
Home |
Main Index |
Thread Index