On Tue, 29 Nov 2016, Pavel A wrote:
>
> Is it possible to test for active option within ash script?
> My version of ash does not seem to recognize "test -o" or [ -o errexit ]

To test on errexit you'd do something like:

        case $- in
                *e*)
                        echo errexit set
                        ;;
                *)
                        echo errexit not set
                        ;;
        esac

The $- thing:

Special Parameters

     - (Hyphen.)  Expands to the current option flags (the single-letter
                  option names concatenated into a string) as specified on
                  invocation, by the set builtin command, or implicitly by the
                  shell.


Cheers,

-- 
Cristian
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to