Normalizing Path Names with Bash
Sep 04, 2009, 01:34 (0 Talkback[s])
(Other stories by Mitch Frazier)
"Each time a dir/.. match is found, variable expansion with
substitution is used to remove the matched part of the path.
"Regular expressions were introduced in bash 3.0. Bash 3.2
changed regular expression handling slightly in that quotes around
regular expressions became part of the regular expression. So, if
you have a version of bash (with regular expression support) and
the code doesn't work, put the regular expression in the while loop
in quotes."
Complete
Story
Related Stories:
- Bash Shell Scripting Online Course(Sep 01, 2009)
- Command Line Cheatsheet(Sep 01, 2009)
- Learn Linux, 101: Text streams and filters(Aug 31, 2009)
- Learn Linux, 101: The Linux command line(Aug 28, 2009)
- Bash Quoting(Aug 27, 2009)
- 5 Simple Bash Tips, Part III(Aug 13, 2009)
- Bash Shell Course: Text Editors(Aug 12, 2009)
- Bash, in Color(Aug 03, 2009)