[Top][All Lists]

[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
> - 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 .


Attachment: smime.p7s
Description: S/MIME cryptographic signature

reply via email to

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