perl script vs bash
perl script vs bash
- Subject: perl script vs bash
- From: Sylvain Pascal <email@hidden>
- Date: Fri, 25 Aug 2006 19:09:14 +0200
Hi! I got an issue with a Perl script under Automator. First, in order to add a process to Finder, i tried to make it by using perl, but it didn't work. I didn't understand, so I went on Internet to find a similar script or an answer to my issue, and i found this: #!/bin/bash for f in "$@" do path=`dirname "$f"` file=`basename "$f"` cd "$path" tar czf "$file.tgz" "$file" done
and mine is:#!/usr/bin/perl -w use File::Basename;
foreach (@ARGV){ $file=basename $_; $dir=dirname $_; chdir $dir or die "erreur, impossible de changer de répertoire: $!"; !system "tar czf $file.tgz $file" or die "erreur à l'éxecution de la commande tar -czf: $!\n"; }
Whereas the first script works well on Automator, the second doesn't. I did this workflow: get selected files > execute a script perl
thanks of your attention, Syl20 |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden