Solved

Tcsh if statement problem

Posted on 2008-06-19
1
4,028 Views
Last Modified: 2013-12-26
I have this code in my tcsh script:
set i=(pgrep startlotj | wc -l)
if ( "$i" > "1" ) exit 0

It's purpose is to kill the new instance of startlotj if there is already one running. However, I get this error: "if: Expression Syntax."
0
Comment
Question by:JonMarkGo
1 Comment
 
LVL 84

Accepted Solution

by:
ozo earned 125 total points
ID: 21825521
did you mean
set i=`pgrep startlotj | wc -l`
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question