aboutsummaryrefslogtreecommitdiffstats
execline: the elglob command

execline
Software
skarnet.org

The elglob program

elglob performs globbing on a pattern, then executes another program.

Interface

     elglob [ -v ] [ -w ] [ -s ] [ -m ] [ -e ] [ -0 ] [ -n ] [ -d delim ] variable pattern prog...
  • elglob performs globbing on pattern.
  • It then performs variable substitution on prog..., using variable as key and the result of the globbing as value. The value is always split: it contains as many words as they are matches for the globbing pattern.
  • elglob then execs into the modified prog....

Options

  • -v : verbose. If there is a problem while globbing, print a warning message on stderr.
  • -w : strict. If there is a problem while globbing, die immediately. This is harsh - you probably don't need that option.
  • -s : sort the matches. By default, the results are left unsorted.
  • -m : mark. Append a slash to each word that corresponds to a directory.
  • -e : no escape. Treat backslashes in pattern literally; do not allow quoting of metacharacters in pattern via backslashes. Warning: the execlineb launcher uses the backslash as their own escape character - if you want a backslash to be passed to elglob, do not forget to double it.
  • -0 : null globbing. By default, if pattern matches nothing, it will be substituted as is (verbatim in one word). With this option, if pattern matches nothing, it will be properly substituted as zero word.
  • -n : chomp. Don't add an ending delimiter at the end of the word. Only valid with the -d option, see below.
  • -d delim : do not split the value. Instead, make it one word, where the result of the globbing are separated by the first character of delim. If the -n option is not given, the first character of delim also appears after the last result. If delim is the empty string, the values are encoded as a sequence of netstrings into a single word, (and you can later separate the words with e.g. define -s).