From the course: Bash Patterns and Regular Expressions

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Make extended globs persistent

Make extended globs persistent - Bash Tutorial

From the course: Bash Patterns and Regular Expressions

Start my 1-month free trial

Make extended globs persistent

- [Instructor] Extended globs may not be turned on by default, but you can make them or any other shell options persistent by adding them to a shell startup file. Bash doesn't always work the same on every operating system. If you're using Linux, you want to put the shopt commands in the .bashrc file in your home directory. For instance, let's turn on extended globs. Type in vi space tilda, slash .bashrc and hit enter. Go into insert mode by pressing the I key and then add in shopt space dash s space extglob. Save and exit by pressing escape colon x, exclamation mark, and hitting enter. To test this, right click and select Open Terminal, and then type in shopt space dash p and hit enter. If it's turned on, then you're good to go. On most Bash installations, there's a difference between a login shell where you type in your password to log in, and an interactive non login shell like one that you would start from the desktop to type commands into. However, on Mac OS 10, all shells are…

Contents