Creating an executable file for Terminal

Discussion in 'Mac Programming' started by Misunder, Apr 21, 2018.

  1. Misunder macrumors newbie

    Joined:
    Apr 21, 2018
    #1
    Right so I wanted to automate a process which I have to do quite often for a program that I run quite often and sometimes open up multiple of.

    Normally I open up Terminal and type in the following commands in order:
    cd ExoClient
    mono ExoClient.exe
    email@gmail.com
    password

    So I made an executable file for this called login.command on my mac. I typed in this is order:
    cd ExoClient
    mono ExoClient.exe
    email@gmail.com
    password

    So the first two lines work but the last two don't do anything. I thought that this could be because the top 2 commands are actual mac commands and the last two lines are just inputs. But I don't know how to make sure the inputs are inputted.

    Thanks for reading, would appreciate any help.
     
  2. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #2
    Your theory is correct; the last two lines aren't commands.

    Try "mono ExoClient.exe email password" or "mono ExeClient.exe /?". It's possible that ExoClient can take the email address and password as parameters.
     
  3. Misunder thread starter macrumors newbie

    Joined:
    Apr 21, 2018
    #3
    Alright, thanks, that works great.

    I wanted to run this 9 more times on for different emails/passes on different terminal windows. Is there a way I could do this using one script?
     
  4. PhoneyDeveloper macrumors 68040

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    scripts that run in a shell inside Terminal can be in various scripting languages like bash, perl, python and others. These languages have loops and functions and variables that you can use to write short programs or scripts. If you look up bash shell scripting you'll find lots of info on how to write these scripts.
     

Share This Page