osx - How to pass multiple commandline arguments to a script?

24
2014-04
  • Jack Buller

    I have a command line script that takes images as arguments. I got it working with one argument but fail to figure out how to pass in multiple.

  • Answers
  • bryan

    In general it is like the following -

    command img1.jpg img2.jpg img3.jpg
    

    But it is dependent on the script.


  • Related Question

    osx - Passing Command Line Args to `open` on Mac
  • dtlussier

    I am using the open command from the Terminal to open an app bundle and would like to pass a command line argument through to the underlying executable.

    Is this possible with the open command?

    The reason I am using the open command at all here is that it doesn't tie up a Terminal window to support the launched process. Are there alternate ways to do this other than the open command ?

    More Information:

    The application I am looking to run is an open source visualization program (Paraview) which I have compiled myself. I know that the basic executable does indeed take command line args. The executable itself is located inside the app bundle paraview.app/Contents/MacOS/paraview.


  • Related Answers
  • NReilingh

    As per $man open, you might be successful with $open MyApp.app --args argument1

    Of course, you could always just run the executable directly and follow your command with an ampersand—that'll background it.

    $/path/to/My.app/Contents/MacOS/executable argument &