Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Same, but using only Bourne shell' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Same, but using only Bourne shell
Authored by: davehole on Sep 07, '05 12:05:22PM
I wrote an example that does the same thing, but without any apple script.

Start a new workflow in Automator and add the Run Shell Script action. For the shell option select "/bin/sh" and for the Pass Input option select "as arguments". then paste in this shell script and save as a finder plugin. Does the same thing, but it's a good example of using the shell with automator


if [ $# == 1 ]; then
	zip -r -j "$1.zip" $1 -x \*.DS_Store
else
	((x=$#-1));
	zip -r -j "$1AND$x-files.zip" $* -x \*.DS_Store
fi

You can now select one file/folder of multiple file/folders in the finder and use your plugin from the automator menu

[ Reply to This | # ]

Same, but using only Bourne shell
Authored by: de291 on Sep 07, '05 01:17:00PM

Is the "fi" at the end of the script correct?



[ Reply to This | # ]
Same, but using only Bourne shell
Authored by: alblue on Sep 07, '05 04:55:32PM

Yes, fi is correct. Bash terminates the 'if' blocks with 'if' in reverse, so 'fi'. The same is true for 'case' statements that end 'esac'.

http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/bash.1.html



[ Reply to This | # ]
Same, but using only Bourne shell
Authored by: de291 on Sep 07, '05 08:33:56PM

Thanks
Too many scripting languages in my head.



[ Reply to This | # ]
add a slash
Authored by: mzs on Sep 07, '05 01:22:01PM
I suggest -x \*/.DS_Store, I assume that without the slash unlikely files like foobar.DS_Store would be excluded too :)

[ Reply to This | # ]