How do I use awk inside my Automator workflow?
January 9, 2011 10:51 AM Subscribe
The Mac OS X Automator tool lets me run a perl script as well shell scripts, but I'd like to use awk instead. How can I fit this into my workflow? Perl appears in the popup menu of possible shells for the script, but awk does not.
posted by maniabug to computers & internet (4 answers total) 1 user marked this as a favorite
I have a number of service-type Automator workflows that transform text. My public has text files that need doctoring, and I give them a nice OSX service so they can just right-click on the offending file to fix it.
In the Run Shell Script region of the workflow, I have been setting the shell to /usr/bin/perl and "Pass input: as arguments". The script text itself starts with the shebang #!/usr/bin/perl, then I go to town. (Yes, learning python is on my to-do list :-)
I'd like to start using awk for some of these, but it doesn't show up as an available shell. Is there a way I can add to Automator's list of "shells"?
If I have to run bash and pass the input to awk, what's the proper way to do it? I can't seem to get that approach to work. I'm sure I'm just being dense, but Automator's generic error is not helping.
Thanks for your help!