bash + Linux + how to ignore the character "!" -


i want send little script remote machine ssh

the script is

#!/bin/bash sleep 1 reboot 

but event not found - because "!"

 ssh 183.34.4.9 "echo -e '#!/bin/bash\nsleep 1\reboot>'/tmp/file"  -bash: !/bin/bash\nsleep: event not found 

how ignore "!" char script send ssh?

remark cant use "\" before "!" because get

more /tmp/file #\!/bin/bash sleep 1 

use set +h before command disable ! style history substitution:

set +h ssh 183.34.4.9 "echo -e '#!/bin/bash\nsleep 1\reboot>'/tmp/file"  # enable hostory expnsion again set -h 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -