LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-11-2023, 03:36 PM   #1
zeroone
LQ Newbie
 
Registered: Jul 2023
Posts: 13

Rep: Reputation: 0
To get state of a flag in set -o..


How do we get state of a flag in set -o ... that has no direct alias
set [-+] , e.g.

set -o posix
or
set -o vi
?

not, e.g. set -o errexit , as it can be retrieved by

$ echo $-

then it'll be determined if letter e exists at the output string. Please help sincerely.
 
Old 07-11-2023, 03:40 PM   #2
thinknix
Member
 
Registered: Nov 2008
Distribution: Lots!
Posts: 178

Rep: Reputation: 58
In bash you can 'echo $SHELLOPTS' or 'set -o' to see what is currently set (the latter is more portable).

Last edited by thinknix; 07-11-2023 at 03:43 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Gparted - to "flag" or NOT to "flag" as "raid" ? helen314 Linux - Newbie 3 06-28-2019 03:02 PM
Help Required adding flag on packet and routing packet based on flag over ssl tunnel. sskhan Linux - Networking 1 02-02-2018 03:56 PM
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set deadeyes Linux - Server 14 07-29-2009 04:30 AM
not work: iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp --dport 3306 -j DROP abefroman Linux - Security 1 07-18-2007 08:19 AM
LXer: State by state, Microsoft responds to creeping threat LXer Syndicated Linux News 0 05-01-2007 07:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration