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
Post a Comment