On 08/25/2015 11:21 AM, Alice Wonder wrote:

cat file.txt |\
   sed -e s?"foo"?"bar"?g |\
   sed -e s?"dirty"?"clean?" |\
> file2.txt

I don't understand why you'd quote that way. Though unlikely, you could potentially match a filename in the working directory, and hose the sed command. For efficiency's sake, you can eliminate cat and one of the two sed processes, and still have a more readable command:

sed -e 's?foo?bar?g' \
    -e 's?dirty?clean?' \
    < file.txt > file2.txt


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Reply via email to