[Iplant-api-dev] Questions about passing boolean variable from DE to api
Wang, Liya
wangli at cshl.edu
Thu Aug 1 15:46:46 MST 2013
Roger,
Thanks. I might need to explain it better.
For the current DE, if x is true, it will be passed as empty. If x is false, it will be ignored so that it will not appear in the command line in iplant.sh.
I am not sure how the API adapter is coded to handle this but none of the approaches I tried actually works.
Liya
On Aug 1, 2013, at 5:49 PM, "Barthelson, Roger A - (rogerab)" <rogerab at email.arizona.edu>
wrote:
> 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