I do this command:
$ locate config.yml | while read i; do sed -i '/(swipe)|(pinch)/s/[0-9].*/1/' $i; done
output:
sed: couldn't open temporary file /home/user/.config/fusuma/sedHhlVCW: Permission denied
sed: couldn't open temporary file /home/var/lib/gems/2.5.0/gems/fusuma-0.11.1/lib/fusuma/sed41YvwW: Permission denied
sed: couldn't open temporary file /var/lib/gems/2.5.0/gems/fusuma-1.10.0/lib/fusuma/sedFSNXeV: Permission denied
So I did with sudo (run as sudo sudo su -> #
, but then not all files were change, and as I see from the error above, the files are temporary and with changed name (postfix of all them consist of command and random chars), does this pipe? If so why? How can I persist filenames over pipe?
$ uname -a
Linux user 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64 GNU/Linux
$ type sed
sed is aliased to `sed -E'
sudo
will not causesed
to run under a different user – Torin May 15 '20 at 20:04sudo su
), like# comand ...
– Herdsman May 15 '20 at 20:06sed
implementation you're working with? – Kusalananda May 15 '20 at 20:11$i
with"$i"
to avoid expanding arguments – Torin May 15 '20 at 20:14sedXXXXX
files are likely due to the implementation ofsed -i
. This usually works by writing to a temporary file and then replacing the target file, rather than writing to the target file directly – Torin May 15 '20 at 20:15