ELGLOB(1)

πŸ“¦ version 2.9.9.2, in nixpkgs unstable

🌸 elglob(1) β€” the globbing-then-exec glow-up ✨

okay bestie, so this is the manual page for elglob, from the General Commands Manual section β€” section 1, commands, iykyk πŸ’…. sit down, grab a strawberry drink πŸ“, and let me tell you about the little tool that globs first and execs second.


✨ NAME ✨

elglob β€” do a glob on a pattern, then run another program. that's it, that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

       prog...

πŸ’– DESCRIPTION πŸ’–

so elglob performs globbing[1] on pattern. yes, the same kind of globbing your shell does β€” the footnote link is right down there in SEE ALSO, no cap πŸ”₯

then it does variable substitution (cf. execline-substitute(7)) on prog..., using variable as the key and the result of the globbing as the value. the way that works is: variable becomes the name, the glob matches become the value πŸ’«

and the value is always split β€” it contains as many words as there are matches for the globbing pattern. always. no exceptions. it's giving "one word per match, periodt" πŸ‘‘

after all that, elglob exec(3)s into the modified prog.... so like, it doesn't stick around, it becomes the program. main character energy fr fr ✨


πŸ’… OPTIONS πŸ’…

  • -v β€” Verbose. if something goes wrong while globbing, it prints a warning message on stderr. just a little heads-up, not a whole meltdown 🫢
  • -w β€” Strict. if something goes wrong while globbing, it dies immediately. and ngl the man page itself says this is harsh β€” you probably don't need that option 😭 like, it's a lot.
  • -s β€” Sort the matches. by default the results are left unsorted, so if you care about order, this is your girl 🌈
  • -m β€” Mark. appends a slash to each word that corresponds to a directory. cute little directory flag, iconic πŸŽ€
  • -e β€” No escape. treats backslashes in pattern literally; does not allow quoting of metacharacters in pattern via backslashes. ⚠️ warning: the execlineb(1) launcher uses the backslash as their own escape character β€” so if you want a backslash to actually be passed to elglob, do not forget to double it. do not forget. i'm serious. double it πŸ’€
  • -0 β€” Null globbing. by default, if pattern matches nothing, it gets substituted as-is (verbatim, in one word). with this option, if pattern matches nothing, it's properly substituted as zero words. zero. nothing. the void πŸ•³οΈ
  • -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 results 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. and 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 (cf. define(1)). fancy, right? 🧚

🌸 SEE ALSO 🌸

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/glob.html

this man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/elglob.html ⭐


πŸ‘‘ AUTHORS πŸ‘‘

  • Laurent Bercot
  • Alexis <flexibeast@gmail.com> (man page port)

and that's the whole page bestie, you ate πŸ’– this one shipped with Debian, dated June 8, 2024, and lives at the very bottom of ELGLOB(1) like a little footer bow πŸŽ€ mwah, go glob something gorgeous πŸ’œπŸ¦‹

πŸ“¦ where this page comes from