Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Escaping pipe character in rsh

Tags:

bash

rsh

I am trying to run this bash command, but I cant get around the "|" pipe character

rsh -l user machine "echo "PORTS = 123|456|789" >> conf.cfg"

Getting:

bash: 456 >> conf.cfg: No such file or directory

bash: 789: command not found

Would you know how I can echo PORTS = 123|456|789 into a remote file ?

Thanks!

like image 238
kirbo Avatar asked Mar 30 '13 12:03

kirbo


1 Answers

Just escape the pipes and the quotes:

rsh -l user machine "echo \"PORTS = 123\|456\|789\" >> conf.cfg"
like image 108
fedorqui 'SO stop harming' Avatar answered Sep 20 '22 23:09

fedorqui 'SO stop harming'