shopt Questions

8

Solved

I have updated my shell to ZSH. When I source ~/.bashrc. I am getting this error There was some error in yo doctor . when i execute this command echo "export NODE_PATH=$NODE_PATH:/usr/local/li...
Soulsearching asked 28/10, 2014 at 18:38

3

Solved

I can't get expand_aliases to take effect in bash. I've tried a lot of different things, and nothing works. Here's the simple test case: /bin/bash -c 'shopt -s expand_aliases; alias cdtmp="cd /tm...
Biisk asked 23/3, 2010 at 15:17

4

Solved

I'm trying to write a bash function that uses nocasematch without changing the callers setting of the option. The function definition is: is_hello_world() { shopt -s nocasematch [[ "$1" =~ "hell...
Vair asked 29/8, 2012 at 13:56

2

I want to loop over all files matching extension jpg or txt. I use: for file in myDir/*.{jpg,txt} do echo "$file" done Problem: If the directory contains no jpg file at all, the loop will...
Hie asked 3/4, 2015 at 18:53

0

Running vscode on Mac. I updated the Mac bash version and, as you can see the built-in vscode terminal shows the same version of bash as that of the Mac terminal. When I source my .bash_profi...
Alejandrinaalejandro asked 8/3, 2019 at 16:13

5

Solved

I know **/*.ext expands to all files in all subdirectories matching *.ext, but what is a similar expansion that includes all such files in the current directory as well?
Rosina asked 6/11, 2009 at 22:7

1

Solved

How to disable a shopt option, for example extglob? I have this in my .bashrc file: shopt -s extglob
Propriety asked 29/5, 2017 at 5:28

2

Solved

If a glob pattern doesn't match any files, bash will just return the literal pattern: bash-4.1# echo nonexistent-file-* nonexistent-file-* bash-4.1# You can modify the default behavior by settin...
Dropkick asked 29/1, 2011 at 20:24

5

Solved

In bash, if you do this: mkdir /tmp/empty array=(/tmp/empty/*) you find that array now has one element, "/tmp/empty/*", not zero as you'd like. Thankfully, this can be avoided by turning on the ...
Chayachayote asked 3/2, 2012 at 9:2

2

I cannot figure it out, i understand shopt -s cdspell but cannot find out what shopt -s dirspell does. The Bash Reference Guide says: dirspell If set, Bash attempts spelling correction on direct...
Congregationalism asked 22/6, 2011 at 10:25

6

Solved

Is there a way to use shell globbing to identify nested directories? so if I have dir/dir1/dir2/dir3/dir4/dir5/.. and I have files under all of them, what is the equivalent globbing pattern to mat...
Kazukokb asked 3/12, 2010 at 19:20

2

When I loop through all the files starting by foo I do for f in foo* ; do echo "result = $f" ; done The problem is when no file start by foo I get: result = foo* Meaning that the loop is exec...
Kentledge asked 8/10, 2014 at 11:27

1

Solved

I put the following unsuccessfully to my .bashrc shopt -s globstar I am trying to test the command in action by ls **/*.c and by comparing it to ls */*/*.c How can you enable globstar in B...
Fiddle asked 27/4, 2009 at 14:20
1

© 2022 - 2024 — McMap. All rights reserved.