help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] Proposed usage of $-


From: Mart Frauenlob
Subject: [Help-bash] Proposed usage of $-
Date: Sun, 13 Jan 2013 11:05:36 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

Hello,

I was wondering what the proposed usage of `$-' is?
I thought it will show me all current set flags, but it is excluding some like posix. The reason for this question is, that I wanted to detect if a script is ran in posix mode. Detect that and print a warning.
But there doesn't seem to be a representation of -o posix|--posix in $-.

$ /opt/bash42/bin/bash +o posix -c 'echo $-'
hBc
$ /opt/bash42/bin/bash --posix -c 'echo $-'
hBc

Thanks for your help

Mart



reply via email to

[Prev in Thread] Current Thread [Next in Thread]