logoalt Hacker News

cillian64today at 9:47 AM0 repliesview on HN

sed can be used to edit files (with the -i option). Not sure how this interacts with piping to its STDIN, but I wouldn't automatically assume `grep | sed` is safe.

I was thinking about this the other day, standard UNIX utilities seem poorly suited for this because they have so many weird options/flags with "unsafe" side effects. I have no idea if grep, for example, has some niche option to make it write/edit/delete files, so I wouldn't be comfortable blanket whitelisting it.