Problem is, when using the sshpass command you need to use ‘ ‘ (apostrophes) in order to input the command. When I try to use nmap, I'm using hostname -I and awk.
The awk ‘{print .. ‘ apostrophe clashes with the sshpass apostrophe.
Is there any alternatives or ways to change that?
I want to run:
sshpass -p “pass” ssh -o Strict…=no user@ip ‘ nmap $(hostname -I | awk ‘{print $1}’) ‘
You need to escape $ with \: