I have tried doing:
echo " mv /server/today/logfile1 /nfs/logs/ && gzip /nfs/logs/logfile1" | sed 's|logfile1|logfile2|g'
It printed:
mv /server/today/logfile2 /nfs/logs/ && gzip /nfs/logs/logfile2
which is a bash command. How can I make it get executed, instead of just printing it?