[Iplant-api-dev] Questions about passing boolean variable from DE to api

Barthelson, Roger A - (rogerab) rogerab at email.arizona.edu
Thu Aug 1 14:49:30 MST 2013


For something like that, I usually just put in if statements:

e.g.
if [ "${x}" == true ];
then
OPT="$OPT -r true";
fi
if [ "${$x}" != true];
then
OPT="$OPT -r false";
fi


In this example, I use $OPT to contain any or all options. So the
executable statement can be something like velveth $OPT $input. I set some
option "-r" to true or false, but this can be used to take care of any
truly optional option. If that makes sense.

Roger


Roger Barthelson Ph.D.
Scientific Analyst
iPlant Collaborative
BIO5 Institute, University of Arizona
Phone: 520-977-5249
Email: rogerab at email.arizona.edu
Web: www.iplantcollaborative.org/
           bio-it.arizona.edu/Roger_Barthelson_Home.html






On 8/1/13 2:19 PM, "Wang, Liya" <wangli at cshl.edu> wrote:

>Hi all,
>
>It seems that boolean variables are handled differently from DE. For
>example, if I have variable x with value 'true', it will be passed as
>'--x='. Otherwise, it will be ignored.
>
>I was expecting that it will be passed as '--x=true' or '--x=false'. Any
>idea how to handle this in the shell wrapper script?
>
>Thanks,
>Liya
>
>
>_______________________________________________
>Iplant-api-dev Mailing List: Iplant-api-dev at iplantcollaborative.org
>List Info and Archives:
>http://mail.iplantcollaborative.org/mailman/listinfo/iplant-api-dev
>One-click Unsubscribe:
>http://mail.iplantcollaborative.org/mailman/options/iplant-api-dev/rogerab
>%40email.arizona.edu?unsub=1&unsubconfirm=1 




More information about the Iplant-api-dev mailing list