IMPORTAS(1)
π IMPORTAS(1) β General Commands Manual, but make it group chat π
okay so bestie, this is importas from the General Commands Manual, section 1. The whole vibe: swap a literal for an environment variableβs value, then go execute another program. Itβs giving βtiny transformation, then main character exec.β β¨
πΈ NAME πΈ
importas β replace a literal with the value of an environment variable, then execute another program.
β¨ SYNOPSIS β¨
importas [-i | -D default] [-u] [-s] [-C | -c] [-N | -n] [-d delim]
variable envvar prog...
importas -S [-i | -D default] [-u] [-s] [-C | -c] [-N | -n] [-d delim]
envvar prog...
π¦ DESCRIPTION π¦
importas fetches the value of envvar from the environment. If neither -D nor -i is given, and envvar is undefined, no word is returned β and that is different from the empty word. no cap, literally a whole different creature.
Then importas performs variable substitution (cf. execline-substitute(7)) on prog..., with variable as the key and that fetched string as the value.
After that, it exec(3)s into the modified prog....
When envvar is undefined, and the -D option is not given, any variable substitution (cf. execline-substitute(7)) with variable as the key will return no word. This is true even when the ${variable} form to be substituted happens in the middle of a word (with a prefix and/or a postfix), which means the whole word will be deleted. If thatβs not the behaviour you want, use the -D option. fr fr, that caveat is important.
π OPTIONS π
-D defaultβ if this is given andenvvaris undefined, substitutedefaultfor the value ofvariableinstead of no word. For instance, to substitute the empty word, use-D "". cute.-iβ Insist. Ifenvvaris undefined,importaswill not do anything; instead, it will exit100with an error message. This has precedence over any-Doption. like, it overrides. π-uβ Unexport.envvarwill be removed from the environment after the substitution.importas -u variable envvaris equivalent toimportas variable envvar unexport envvar.-Sβ Import with same name. This option allowsvariableto be omitted; it will be the same asenvvar. In other words,importas -S varis the same asimportas var var. slay, less typing.
Other options are used to control the substitution mechanism (cf. execline-transform(7)). The synopsis also shows -s, -C | -c, -N | -n, and -d delim; those are the other substitution-mechanism controls, and this page doesnβt unpack them further β execline-transform(7) is the one to read.
π SEE ALSO π
define(1)elgetpositionals(1)elglob(1)multidefine(1)multisubstitute(1)exec(3)execline-substitute(7)execline-transform(7)
This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/importas.html
π AUTHORS π
- Laurent Bercot
Alexis <flexibeast@gmail.com>(man page port)
π and thatβs the whole page: Debian, dated June 8, 2024 β this is the IMPORTAS(1) moment from the General Commands Manual. bye bestie, go substitute responsibly π«Ά
π¦ 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