execline
Software
www.skarnet.org
execline [ -q | -w | -W ] [ -p | -P ] -c script [ args... ]or
execline [ -q | -w | -W ] [ -p | -P ] scriptfile [ args... ]or in an executable file:
#!/command/execline [ -qwWpP ] script
Parsing phase.
Environment management phase.
Execution phase.
An execline script is a string that must not contain the null character. execline parses it and divides it into words. The parser recognizes the following components:
For proper execution of the script, the sequence of words must follow the execline grammar. WARNING: execline performs direct argv construction, without transformation to the script. In particular, it has no support for blocks, so if you need blocks in your script, you will have to quote them by hand and make sure your script is well-formed (every word inside n blocks, including semicolons (block terminators), must be preceded by n tildas). An ill-formed script is a security risk. Use of the execline launcher is discouraged; you are advised to use execlineb instead.
External execline commands that read blocks, like foreground, use the EXECLINE_STRICT environment variable: if it is set to 1, they will print a warning message on stderr if they find their blocks not to be properly quoted. If it is set to 2, they will also die. If it is set to 0, or unset, they won't complain at all.
Normally the EXECLINE_STRICT environment variable is unset (or inherited from the caller if the -P option is given). You can force it unset, set to 1, or set to 2 by giving respectively the -q, -w or -W option to execline.
Normally, execline scripts are reentrant: environment variables potentially overwritten by execline, such as #, 0 or EXECLINE_STRICT, are pushed. This is the standard, safe behaviour. Nevertheless, it is rather costly, and may be unneeded for small scripts: for those cases, execline-1.05 comes with two options that bypass the environment management. Be warned that the sole purpose of these options is optimization, and you should not use them if you're not familiar with the way execline uses the environment to store positional parameters.
execline builds and executes a unique argv with the script: hence scripts are subject to OS-dependent limitations such as the kernel buffer size for argv and envp - at least 64 kB on most systems. This means that execline cannot execute arbitrarily large scripts. Be careful with deeply nested scripts too: without the -p option, each execline invocation uses up some space in the environment.