Short code to retype

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mrlim0nad3
Posts: 1
Joined: 11 Aug 2016 14:49

Short code to retype

#1 Post by mrlim0nad3 » 11 Aug 2016 14:55

I have a file name HoneyBat.bat and i would like to run it on my mac and my VPS. I'm not able to convert it so it can be run by terminal.

Here is the code and i would like to run in on mac so i think .sh file would be great. Thanks for helping!!

Code: Select all


taskkill /IM python.exe /F

Start "Server" /min python runserver.py -a ptc -a ptc -u ZHNuRmn3gXGzZaX -u W9dCzIgTE4WCJlR -p P0kemong0 -p P0kemong0 -st 5 -k AIzaSyDDQJ-vZk7IxwofLAV2YAXH1rOKDxyB9hM -l "(46.80805,-71.207886)" -sd 5 -dc --db-max_connections 500
ping 127.0.0.1 -n 6 > nul

Start "Moveable" /min python runserver.py -a ptc -a ptc -u TaCV1LQM60uAu2b -u 0GB5d19nRkDFrku -p P0kemong0 -p P0kemong0 -st 5 -k AIzaSyDDQJ-vZk7IxwofLAV2YAXH1rOKDxyB9hM -l "(46.800706,-71.220417)" -ns -sd 5 -dc --db-max_connections 500
ping 127.0.0.1 -n 6 > nul

Start "Moveable" /min python runserver.py -a ptc -a ptc -u 0GB5d19nRkDFrku -u yI3uVCL5OvQsozI -p P0kemong0 -p P0kemong0 -st 5 -k AIzaSyDDQJ-vZk7IxwofLAV2YAXH1rOKDxyB9hM -l "(46.800405,-71.28886)" -ns -sd 5 -dc --db-max_connections 500
ping 127.0.0.1 -n 6 > nul

Start "Moveable" /min python runserver.py -a ptc -a ptc -u yI3uVCL5OvQsozI -u y3SL9X0wmDbAojl -p P0kemong0 -p P0kemong0 -st 5 -k AIzaSyDDQJ-vZk7IxwofLAV2YAXH1rOKDxyB9hM -l "(46.80456,-71.204817)" -ns -sd 5 -dc --db-max_connections 500
ping 127.0.0.1 -n 6 > nul

Start "Moveable" /min python runserver.py -a ptc -a ptc -u y3SL9X0wmDbAojl -u rO0j51Kgil5R10f -p P0kemong0 -p P0kemong0 -st 5 -k AIzaSyDDQJ-vZk7IxwofLAV2YAXH1rOKDxyB9hM -l "(46.80085,-71.209086)" -ns -sd 5 -dc --db-max_connections 500
ping 127.0.0.1 -n 6 > nul
pause

douglas.swehla
Posts: 75
Joined: 01 Jun 2016 09:25

Re: Short code to retype

#2 Post by douglas.swehla » 11 Aug 2016 17:49

While batch and shell scripts both use command lines, those commands are sent to entirely different programs: Batch scripts are interpreted by cmd.exe on Windows, and shell scripts are interpreted by any of several programs (sh, bash, ksh) on *nix and OS X. These programs support a different set of internal and external commands, so there's no reliable way to convert between them. The upshot is that you're not not going to get a batch script to run on your Mac, unless you've got Windows installed on it.

You'll need to rewrite your batch script as a shell script, with a particular shell in mind. I think Bash is most popular in the Mac world. The good news is that your script is pretty simple. It looks like you're mostly just running a series of Python commands, so you should be able to find the equivalent commands pretty easily, possibly in the Python documentation.

This site (http://tldp.org/LDP/abs/html/dosbatch.html) has a list of commonly used utilities and their equivalents, if you run into this problem again.

Post Reply