Re: A sh -c '${name} and $name' are treated inconsistently within a .service unit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Am 27.08.20 um 18:11 schrieb u34@xxxxxxx:
> [Unit]
> Description=Is it looking for ${} construct in the wrong place?
> [Service]
> Type=oneshot
> ExecStart=/bin/bash -c 'set -x; declare -r str="1 2"; echo ${str}; echo $str; exit 0;'
> 
> When ran, the journal has:
> 
> bash[14190]: + declare -r 'str=1 2'
> bash[14190]: + echo
> bash[14190]: + echo 1 2
> bash[14190]: 1 2
> bash[14190]: + exit 0
> 
> Note the top bash[14190]: + echo line. It has no arguments. Since the other echo line
> has its 1 2 arguments, I find this behaviour inconsistent. And surprising. As such, I
> think this is a bug.
> It could be that the ${NAME} construct is looked for in the environment. But then, why 
> $NAME works in the script, but not ${NAME}?

if you want a script just use a script and call it with ExecStart
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux