Re: while if string compare
From: Chris F.A. Johnson (cfajohnson_at_gmail.com)
Date: 01/05/05
- Next message: Billy Patton: "Re: while if string compare"
- Previous message: Chris F.A. Johnson: "Re: cat and line feed"
- In reply to: Billy Patton: "Re: while if string compare"
- Next in thread: Billy Patton: "Re: while if string compare"
- Reply: Billy Patton: "Re: while if string compare"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 4 Jan 2005 23:31:05 GMT
On Tue, 04 Jan 2005 at 23:16 GMT, Billy Patton wrote:
> On Tue, 4 Jan 2005, Chris F.A. Johnson wrote:
>
>> On Tue, 04 Jan 2005 at 22:28 GMT, Billy Patton wrote:
>>> I'm trying to loop sleeping 2 minutes each time
>>> when bjobs is empty str will be empty
>>> The following gwets me a
>>>> tcsh -x ./x
>>> while ( 1 )
>>> set str = `/usr/local/lsf/bin/bjobs`
>>> /usr/local/lsf/bin/bjobs
>>> if ( JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME 336642
>>> bpatton RUN normal holster07.d lag13.dal.d sleep 400 Jan 04 16:22 == ) then
>>> if: Expression Syntax.
>>>
>>>
>>> while ( 1 )
>>> sleep 120
>>> set str = `/usr/local/lsf/bin/bjobs`;
>>> if ( $str == '' ) then
>>
>> if ( "$str" == '' ) then
>>
>>> echo "no more jobs"
>>> break;
>>> endif
>>> end
>
> Problem now is that he string gets too long.
> It can be K lines long.
>
> What can I use instead of "$str" == '' ?
>
> I get "Word too long." error and it stops?
Use a real scripting shell. :)
#!/bin/sh
while :
do
sleep 120
str=`/usr/local/lsf/bin/bjobs`
if [ -x "$str" ]
then
echo "no more jobs"
break
fi
done
--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
===================================================================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
- Next message: Billy Patton: "Re: while if string compare"
- Previous message: Chris F.A. Johnson: "Re: cat and line feed"
- In reply to: Billy Patton: "Re: while if string compare"
- Next in thread: Billy Patton: "Re: while if string compare"
- Reply: Billy Patton: "Re: while if string compare"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|