Register
It is currently Fri Jul 25, 2014 10:01 am

assign boolean expression to variable


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Sun Jul 26, 2009 4:59 am   
User avatar

Joined: Sun Jul 26, 2009 3:08 am
Posts: 1
I would like to assign true/false to $RUN in one line rather than using the clumsy if statement below.

Code:
: ${DELETE:=false}
: ${FORCE:=false}
: ${SKIP:=false}
RUN=true
if $DELETE && ! $FORCE && ! $SKIP && [ -z "$RUNDAY" ] ; then
    RUN=false
fi


I tried

Code:
RUN=! $DELETE || $FORCE || $SKIP ||  [ -n "$RUNDAY" ]



Any help is much appreciated.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP