0

I currently have a workflow which relies on several bash commands sequentially in the OSX terminal. It is basically a process which starts with a file x.csv, it does an operation on it and generates another file y.dat. Then uses y.dat as input for another command line app and produces the output z.png.

I want to write a script to automate the procedure with a script that takes in x and produces z directly. I don't know how to do it, or if to use AppleScript or bash and how.

Thanks

0

2 Answers 2

1

In bash you can use a pipe i.e. | to pass the output of one command as the input of the next.

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html

-1

I used the tutorial in http://floppix.ccai.com/scripts1.html to get started. That is all I needed. I execute a command and use a variable to store the filename of the output. I then execute the next command passing the filename of the previous stage as a parameter.

3
  • Please expand your answer and explain what exactly you did. Having a link is nice but it doesn't really tell us how you solved your problem.
    – slhck
    Dec 18, 2012 at 14:26
  • You are just linking to a short cookbook for a simple script (which does not contain any hint about how to pipe data from one process to the other)
    – Matteo
    Dec 18, 2012 at 14:30
  • I added some more detail. Basically I'm just using intermediate files instead of passing the output directly onto the next command.
    – Nicolas
    Dec 18, 2012 at 14:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .