[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: definite way to determine the running shell
From: |
Christoph Anton Mitterer |
Subject: |
Re: definite way to determine the running shell |
Date: |
Fri, 27 Mar 2015 20:37:50 +0100 |
On Fri, 2015-03-27 at 01:44 -0600, Eduardo A. Bustamante López wrote:
> Why would the user set BASH_VERSION in the environment? That sounds like
> asking
> for trouble!
Murphy's law! :D
> - try to unset BASHOPTS (did it work? then it's not bash)
> - Now, store the value of BASHOPTS in a temp var
> - Set a shopt option that's not set already in BASHOPTS (or unset one from
> BASHOPTS)
> - Check if the value of BASHOPTS changed.
that sounds like a nice idea.
I just thought about another "solution" myself
PATH="" shopt
then only a shell having shopt (hopefully that is just bash) should give
$?=0 .
Thanks,
Chris.
smime.p7s
Description: S/MIME cryptographic signature
- definite way to determine the running shell, Christoph Anton Mitterer, 2015/03/26
- Re: definite way to determine the running shell, Eduardo A . Bustamante López, 2015/03/27
- Re: definite way to determine the running shell,
Christoph Anton Mitterer <=
- Re: definite way to determine the running shell, Clark Wang, 2015/03/27
- Re: definite way to determine the running shell, Andreas Schwab, 2015/03/27
- Re: definite way to determine the running shell, Eric Blake, 2015/03/27
- Re: definite way to determine the running shell, Christoph Anton Mitterer, 2015/03/27
- Re: definite way to determine the running shell, Greg Wooledge, 2015/03/27
- Re: definite way to determine the running shell, Christoph Anton Mitterer, 2015/03/27
- Re: definite way to determine the running shell, Greg Wooledge, 2015/03/27
- Re: definite way to determine the running shell, Christoph Anton Mitterer, 2015/03/27
- Re: definite way to determine the running shell, Dan Douglas, 2015/03/27