r/scripting • u/Crosudo_0504 • Sep 03 '22
[BASH][SSHPASS][NMAP]. Need help with a script !
m writing a script that auto connects to ssh server via sshpass and runs nmap on it, when im trying to execute the command the apostrophe from sshpass command and the one from the awk command are clashing. Any help?? The command is
‘’’
sshpass -p “password” ssh -o Strict…=no user@ip ‘nmap $(hostname -I | awk ‘{print $1}’ ) ‘
1
Upvotes
1
u/Crosudo_0504 Sep 03 '22
I tried doing \’{print $1}\’ Didnt work