#!/usr/bin/perl use Cwd; use String::ShellQuote; my $USER = $ENV{USER}; my $dir = getcwd; ( my $prefix = $dir ) =~ s(^/home/$USER/freeside/?)() or die $dir; #eventually from anywhere system join('', "git add @ARGV ; ", "( for file in @ARGV; do ", "cp -i \$file /home/$USER/freeside2.3/$prefix/`dirname \$file`;", "done ) && ", "cd /home/$USER/freeside2.3/$prefix/ && ", "git add @ARGV" );