Run command fails with "Unknown command" error
Hello,
I have a scenario where I have to copy a sh script and multiple ESXi hosts, Change the permission and run it.
The file copy is working fine.
For changing the permissions
To run the script I run it in a new session using
Full code used is the following:
Could you confirm this is the correct way to proceed?
Or what I am doing wrong?
Thanks a lot in advance for your help,
I have a scenario where I have to copy a sh script and multiple ESXi hosts, Change the permission and run it.
The file copy is working fine.
For changing the permissions
chmod +x
wasn't accepted but the workaround was to use chmod 755
.
To run the script I run it in a new session using
setsid
(as described in VMware KB). Unluckily WinSCP returns "Unknown command ''setsid'." error message while running the same in PuTTY works fine.
Full code used is the following:
open %1% put "C:\temp\lwis-mem-check-2.sh\lwis-mem-check-2.sh" /tmp/ put "C:\temp\lwis-mem-check-2.sh\local.sh" /etc/rc.local.d/ chmod 755 /tmp/lwis-mem-check-2.sh setsid /tmp/lwis-mem-check-2.sh >/dev/null 2>&1 < /dev/null & exit
Or what I am doing wrong?
Thanks a lot in advance for your help,