DOLLARAT(1)
π DOLLARAT(1) β General Commands Manual realness π
πΈ NAME πΈ
dollarat β print the positional parameters of an execline script. That's the assignment, bestie: it prints the positional parameters. Periodt. π
β¨ SYNOPSIS β¨
dollarat [-n] [-0 | -d delimchar]
π¦ DESCRIPTION π¦
Okay so here's the tea: dollarat reads the number n of βpositional parametersβ in the # environment variable. If that variable is not set or does not contain a valid n, dollarat exits 100. π
dollarat prints the value of the 1 environment variable, then delimchar, then the value of the 2 environment variable... and so on until n. If one of these variables is not set, dollarat exits 100. π
If everything runs OK, dollarat exits 0. This makes it one of the rare βexitingβ execline commands. Iconic behavior, honestly. π
You can use dollarat -d "" along with the forbacktickx(1) command to reliably loop over the positional parameters:
#!/command/execlineb
forbacktickx -d "" ARG { dollarat -d "" }
dosomething $ARG
will call dosomething in turn on each argument to the script. That will work even if those arguments contain spaces, newlines, or other fancy characters. No cap, fancy characters included. β¨
Alternatively, instead of encoding data into a netstring, you can use a null-separated list, which will work the same way:
#!/command/execlineb
forbacktickx -0 ARG { dollarat -0 }
dosomething $ARG
π OPTIONS π
-nβ chomp. Do not print the last delimchar. Snip snip, bestie. π-d delimcharβ Use the character delimchar as separator between the arguments. Default:\n. If delimchar has more than one character, only the first one is used. If delimchar is the empty string, thendollaratwill output the positional parameters as a sequence of netstrings (cf.execline-transform(7)) and the-noption will be ignored. So cute, so specific. π-0β Use the null character as separator. If this option and the-doption are given concurrently, the rightmost one wins. Warning:-0should only be used to feed data to programs that know how to handle null-separated lists.
β οΈ That -0 warning is real: only feed null-separated lists to programs that know how to handle null-separated lists. Do not just yeet nulls everywhere, okay? π
π SEE ALSO π
This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/dollarat.html π¦
π AUTHORS π
- Laurent Bercot
Alexis <flexibeast@gmail.com>(man page port)
π Debian β February 14, 2021 β DOLLARAT(1), out! That's the footer, bestie. Mwah! π
π¦ where this page comes from
- nixpkgs unstable: execline 2.9.9.2
- nixpkgs unstable: execline-man-pages 2.9.9.1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms