I have something like this in a systemd service
script = ''
$(for x in `${pkgs.coreutils}/bin/ls ${directory}`; do echo ${x}; done)
'';
Is there a way to escape ${x}
so it is part of the shell script and ignored by nix?
I have something like this in a systemd service
script = ''
$(for x in `${pkgs.coreutils}/bin/ls ${directory}`; do echo ${x}; done)
'';
Is there a way to escape ${x}
so it is part of the shell script and ignored by nix?
Yes, you can escape ${x}
by prefixing it with 2 single-quotes: ''${x}
, though remember, that there is no need to escape $x
.
Similarily, if you ever need 2 singlequotes, just write 3 of them.
Thanks to both of you.