Skip to main content

read the glob docs! And never forget the sacrafice that glob is making for you.

extglob changes the way certain characters are parsed. It is necessary to have a newline (not just a semicolon) between shopt -s extglob and any subsequent commands to use it.You cannot enable extended globs inside a group command that uses them, because the entire block is parsed before the shopt is evaluated. Note that the typical function body is a group command. An unpleasant workaround could be to use a subshell command list as the function body.
Therefore, if you use this option in a script, it is best put right under the shebang line.
Toggle line numbers
   1 #!/usr/bin/env bash
   2 shopt -s extglob   # and others, such as nullglob dotglob
   3 


Comments

Popular posts from this blog

Many organizations get vertical and horizontal confused. Their 'verticals' cross-cut the vertical stack and are really 'horizontals'.        scrum-teams-vs-traditionally-organized-teams

npackd for the masses

For the developer masses stuck on the newer flavors of Windows - npackd shows some promise. An apt-get like interface for installing/tracking typical tools on your workstation.  Silently, checks SHA1 and tracks versions for easy update/rollback.  Repository is growing. Finds already installed packages and can scan for additional.