Is there a way to shorten these commands? because this script asks for a password 3 times
scp -p /usr/local/bin/${script_name} ${servername$iy]}://usr/local/bin/
ssh ${servernames[$iy]} /usr/local/bin/${script_name}
ssh ${servernames[$iy]} rm -f /usr/local/bin/${script_name}
Basically, I'm creating a script within a script, pushing it out to a server, execute it, and then removing it.
Thanks in advance.
scp -p /usr/local/bin/${script_name} ${servername$iy]}://usr/local/bin/
ssh ${servernames[$iy]} /usr/local/bin/${script_name}
ssh ${servernames[$iy]} rm -f /usr/local/bin/${script_name}
Basically, I'm creating a script within a script, pushing it out to a server, execute it, and then removing it.
Thanks in advance.