2 ms·
Try sed s/foo/bar/ -i file to edit file.
by atsaloli 6y ago
Try
sed s/foo/bar/ -i file
to edit file.
- GuB-42 6y agoThat what I do now, one thing to note though is that the "-i" option is not always available. Usually, now, it is, but we still have a couple of Solaris servers at work that don't support it. This, btw, is why I hate shell scripts. There are so many variants of bourne shells and UNIX tools that writing a portable script is a minefield, as if properly dealing with spaces wasn't tricky enough...
- atsaloli 6y agoRight you are. The -i option is not standard (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/s...)