From the course: Bash Patterns and Regular Expressions
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Make extended globs persistent - Bash Tutorial
From the course: Bash Patterns and Regular Expressions
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
What are extended globs?5m 2s
-
(Locked)
Why you should use extended globs4m 37s
-
(Locked)
Make extended globs persistent1m 10s
-
(Locked)
Getting started with extended globs3m 4s
-
(Locked)
Pattern matching with extended globs5m 44s
-
(Locked)
Using extended globs with commands5m 1s
-
(Locked)
Comparing extended globs with regular expressions2m 22s
-
-
-
-
-
-
-
-