5 Batch file to shell script

If you have been a batch file in Windows to start your VM, it is easy to convert it to a shell script. Let us assume the name of your batch file is startvm.bat. The following steps will make a shell script out of it (you don’t have to copy the comments!):

echo ’#!/bin/sh’ > startvm.sh  # first line should indicate how to run it  
dos2unix < startvm.bat >> startvm.sh  # now copy the command  
chmod 755 startvm.sh           # change the permissions  
  

To run the shell script, you have to prepend it with ./ to mean “from the current directory”. You also have to spell out the full file name including the extension. For example:

./startvm.sh