The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
How can I get an if statement to execute based on number of lines in a file?
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Portal
Register
Rules & FAQ
Contribute
Members List
Arcade
Search
Today's Posts
Mark Forums Read
Thread
:
How can I get an if statement to execute based on number of lines in a file?
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
5
(
permalink
)
05-14-2004
LordJezo
Registered User
Join Date: May 2004
Posts: 45
Script looks like this:
#!/bin/sh
if [ $( ps -ef | grep wtrs | wc -l ) -gt "3" ];
then
echo its running things
else
echo it can be shut down
fi
error it gets when run:
syntax error at line 2: `(' unexpected
LordJezo
View Public Profile
Find all posts by LordJezo