On Wed, Jul 10, 2013 at 8:35 PM, Geir Hauge <geir.ha...@gmail.com> wrote:
> 2013/7/10 Bruce Korb <bruce.k...@gmail.com>
>
>> This seems like a lot of obtuse bother:
>>
>> xtrace_setting=$(
>>    re=$'\nxtrace[ \t]+on'
>>    [[ $(set -o) =~ $re ]] && echo ' -x' || echo ' +x')
>>
>> if there were only some magic like ${BASH_SETTING_XTRACE} or
>> xtrace_setting=$(set -q xtrace) or something.  Could we get
>> something fairly straight forward for querying set/shopt state?
>> Thank you for considering.  Regards, Bruce
>>
>
> shopt -qo xtrace && xtrace=1
>

For the single letter options you can also use the standard: case $- in *x*) ...

Reply via email to