how to escape the ' in ssh?

Posted by Dean Hiller on Super User See other posts from Super User or by Dean Hiller
Published on 2012-08-27T19:40:15Z Indexed on 2012/08/27 21:42 UTC
Read the original article Hit count: 342

Filed under:

I need to escape the ' in this command for ssh exec

grep IPADDR /etc/sysconfig/network-scripts/ifcfg-eth0 |awk -F= '{print $2}'

How do I escape that?

I currentl y have this which does not work

ssh host 'grep IPADDR /etc/sysconfig/network-scripts/ifcfg-eth0 |awk -F= '{print $2}''

nor does this

ssh host 'grep IPADDR /etc/sysconfig/network-scripts/ifcfg-eth0 |awk -F= \'{print $2}\''

thanks, Dean

© Super User or respective owner

Related posts about bash