#!/bin/bashecho "xxx yyyxxx" | perl -pe '$c+=s/yyy/zzz/; END { $?=$c }' && echo "No replacement"
Standard input is empty
xxx zzzxxx
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!