7 substenv - Substitute environment variables in parameters and run the resulting command
11 substenv I<COMMAND> [I<ARGS>]
15 Replace all occurrances of C<$NAME> in I<COMMAND> and I<ARGS> to the I<NAME> environment
16 variable's value, then run I<COMMAND>.
20 system('substenv', 'ls', '$HOME/.config')
24 execve('ls', ['ls', '/home/jdoe/.config'])
28 Does not support full shell-like variable interpolation.
29 Use a real shell for it.
33 Sometimes you don't want a shell to be in the picture when composing commands,
34 yet need to weave some environment variable into it.
38 envsubst(1) from gettext-base package
47 $arg =~ s/\$([A-Z0-9_]+)/$ENV{$1}/g;
51 exec {$run_cmd[0]} @run_cmd;