The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
1answer
125 views

Why does history not overwrite but append when histappend is set to off in Bash?

Several days ago, I had one Terminal tab doing ssh, and the other doing a lot of work locally. And then I restarted the machine (on a Mac with Mavericks). When I ran Terminal again, I found that all ...
0
votes
4answers
101 views

Is there a “ls” replacement that can handle wildcards?

I just learned that ls cannot handle wildcards (ls '*' does not work) and therefore the shell does it before ls is invoked. So the behaviour of ls may be considered as logically for people working 20 ...
30
votes
4answers
4k views

Set and Shopt - Why Two?

set and shopt are both shell builtins that control various options. I often forget which options are set by which command, and occasionally which option sets/unsets (set +o/-o, shopt -s/-u). Why are ...
0
votes
1answer
168 views

Scope of shopt options in cron script

I have a bash script that is run nightly in a cron job. It needs to do case insensitive file matching, so the script calls shopt -s nocaseglob I want to make sure this does not affect other cron ...
1
vote
0answers
26 views

How to combine Bash's read with HERE-document when shopt -os errexit is in place? [duplicate]

I am trying to make use of the solution presented in one of the answers of http://stackoverflow.com/questions/1167746/how-to-assign-a-heredoc-value-to-a-variable-in-bash In Bash version 4.2.47(1)-...
0
votes
1answer
206 views

Is there a command which displays options like `errexit` and `braceexpand` other than `help set`?

If you type help set, then - among other things - a list of shell options is displayed. But these options are not the same as those displayed with shopt. And different also from those displayed with ...
5
votes
3answers
300 views

How can I make my .bashrc call to shopt -s autocd depend on the bash version?

In Ubuntu I like having shopt -s autocd in my .bashrc file for automatic CD'ing with typing 'cd', i.e. just type the directory name (and probably use tab completion too) and press return and be cd'...
7
votes
2answers
971 views

How do you get descriptions of the available `shopt` options?

What is the canonical way for accessing the local documentation on any available Shell Options builtin with shopt? I'm using Ubuntu 12.04 and can run help shopt to get a description of what shopt ...
3
votes
1answer
529 views

bash not setting autocd

I try to set autocd option in bash so I don't have to type cd src and can just type src. However shopt -s autocd gives me: -bash: shopt: autocd: invalid shell option name (Ubuntu 8.04 hardy)
4
votes
2answers
619 views

Function caller positional parameters

I need to read and write the positional parameters $@ of a function's caller. The Bash man page says that: A shell function is an object that is called like a simple command and executes a ...
4
votes
1answer
1k views

What are the scope restrictions for setting shopt extglob. and other options?

My non-interactive bash shell has extglob off. I would like to turn it on in the statement immediately before a command, but I have noticed that when shopt -s extglob is within an if .. then .. else ...