* Querying the state of shell options
@ 2012-04-01 2:10 gi1242+zsh
2012-04-01 2:44 ` TJ Luoma
0 siblings, 1 reply; 3+ messages in thread
From: gi1242+zsh @ 2012-04-01 2:10 UTC (permalink / raw)
To: zsh-users
Hi All,
After RTFM'ing a while, I couldn't find the answer to the following: Is
there a way to check the status of an option? For instance, if I to
check if "login" is set, can I find out?
The only way I can think of now is to grep the setopt output for the
desired option (and comparing to the default state in the zsh man page).
I'm hoping there's a better way,
Thanks in advance,
GI
--
Binary -- as easy as 1, 10, 11.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Querying the state of shell options
2012-04-01 2:10 Querying the state of shell options gi1242+zsh
@ 2012-04-01 2:44 ` TJ Luoma
2012-04-01 3:21 ` gi1242+zsh
0 siblings, 1 reply; 3+ messages in thread
From: TJ Luoma @ 2012-04-01 2:44 UTC (permalink / raw)
To: gi1242+zsh; +Cc: zsh-users
[-- Attachment #1: Type: text/plain, Size: 67 bytes --]
I believe this will work
if [[ -o login ]]
then
whatever
fi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Querying the state of shell options
2012-04-01 2:44 ` TJ Luoma
@ 2012-04-01 3:21 ` gi1242+zsh
0 siblings, 0 replies; 3+ messages in thread
From: gi1242+zsh @ 2012-04-01 3:21 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 222 bytes --]
On Sat, Mar 31, 2012 at 10:44:10PM -0400, TJ Luoma wrote:
> I believe this will work
>
> if [[ -o login ]]
> then
> whatever
> fi
Perfect, thanks a ton!
GI
--
'Code Orange' -- Eat dessert first.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-01 3:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-01 2:10 Querying the state of shell options gi1242+zsh
2012-04-01 2:44 ` TJ Luoma
2012-04-01 3:21 ` gi1242+zsh
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).