Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've saved it in /usr/bin to give me systemwide capability. In essence, the script should run through a four step process-#!/usr/bin/perl while(<*>) { $o = $_; s/\ /\¬/g; rename($o, $_); } foreach (<*.avi>) { $cmd = "mkvmerge $_ -o "; s/\.avi$/.mkv/; $cmd .= $_; print "$cmd\n"; system($cmd); } @filelist = glob("*.avi"); unlink @filelist; foreach (<*.ogm>) { $cmd = "mkvmerge $_ -o "; s/\.ogm$/.mkv/; $cmd .= $_; system($cmd); } @filelist = glob("*.ogm"); unlink @filelist; foreach (<*.mp4>) { $cmd = "mkvmerge $_ -o "; s/\.mp4$/.mkv/; $cmd .= $_; system($cmd); } @filelist = glob("*.mp4"); unlink @filelist; while(<*>) { $_ = $o; s/\ /\¬/g; rename($_, $o); } while(<*>) { $o = $_; s/\¬/\ /g; rename($o, $_); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why does this only work correctly as root?
by ig (Vicar) on Aug 06, 2009 at 12:07 UTC | |
by moritz (Cardinal) on Aug 06, 2009 at 12:14 UTC | |
|
Re: Why does this only work correctly as root?
by jethro (Monsignor) on Aug 06, 2009 at 12:18 UTC | |
|
Re: Why does this only work correctly as root?
by Anonymous Monk on Aug 06, 2009 at 15:39 UTC | |
by jethro (Monsignor) on Aug 10, 2009 at 08:37 UTC |