Windows does not understand shell commands and linux does not understand dos commands so this is not possible if that’s what you are asking.
If you want to put the OS appropriate syntax into an arbitrary file and execute in on the correct platform then yes, that is possible.
Why are you trying to run dos commands on a linux server?
i have run .sh command and in the last step for this script i have to run .bat script in windows vm
i tried to used nexec <hostname> windows path scriptname.bat parameter
but its not work.
do u have other way to perform that?
You are trying to call nexec from inside the script you are running on the linux box? is nsh installed on the linux box ?
yes that right!
i call nexec inside shell script and run in the linux box
If nsh ins not installed on the linux box than this will not work.
Can you do two jobs?
you mean i have to split the script to tow job? one for first normal .sh script and the second for nexec command ?
nsh is installed in linux box
Can you post the script ?
echo HOSTNAME=$2 > /tmp/named.add
echo FullDomain=$3 >> /tmp/named.add
echo IP = $4 >> /tmp/named.add
nexec $hostname /program file/test/bmc test/installation.bat <servername>
I would cd to the target dir before running the command.
cd //<servername>/C/Program Files/etc.
nexec $hostname cmd /C installation.bat
why are you running this against a linux server and then run against a windows server?
why not target the windows server only?
what is this script supposed to do ?
Using Cygwin you can able to execute SH script on Windows machine. its work like Bash Shell and most of the command are supported in Cygwin.