Shell-Skripte
Kleine, nützliche Skripte, die das Leben mit der Kommandozeile vereinfachen.Alle Skripte werden so, wie sie sind, veröffentlicht, und ich garantiere nicht dafür, daß sie funktionieren, überhaupt für etwas gut sind und keinen Schaden an Hard- oder Software anrichten.
Batch-Renamer
Meine erste Shell-Script-Erfahrung.Sehr komfortables Massen-Umbenennen von Dateien und Unterordnern.
Soweit ich weiß ist es das einzige Programm, das Nummern/Strings vertauschen kann.
Benötigt das Kommandozeilenprogramm "mmv".
Das Skript enthält noch ein paar Fehler, ist im Großen und Ganzen aber gut zu gebrauchen.
Optionen:
Interface to mmv
(c) by Georg Hennig 2004
Usage:
renamer [ options ] [ additional strings ] [ input ]
Simple options:
-v --verbose Give feedback, what is done
-r --recursive Renames files also in subdirs
-R --directories Renames also subdirs themselves
-x --extended 'I'M_dj MC Donalds?' is renamed to
'I'm DJ McDonalds'
-l --umlaute Replaces German Umlaute
-u --upcase 'it's only rock'n'roll' is renamed to
'It's Only Rock'n'roll'
-c --spaces Removes spaces
Extended options:
-p --replace "string_1" "string_2"
Replaces string_1 by string_2
string_2 may be empty
-i --insert "string" "position"
Inserts string at position
position is an integer, starting at 0
-s --swap "argument_1" "argument_2"
Swaps argument_1 and argument_2
argument 1 and 2 may be
- a string
- # (= a single number)
- ## (= a double number)
in any combination
-d --delete "argument"
Deletes a number
argument may be
- # (= a single number)
- ## (= a double number)
-d --delete "position" "length"
Deletes a string
position is an integer, starting at 0
length is an integer
Input:
Valid inputs:
- "*" (= any file)
- "some_prefix*"
- "*some_suffix"
- "some_prefix*some_suffix"
- "" (left empty = any file)
Please note:
- Simple options may be combined as desired, but you may only choose ONE extended option.
- If multiple options are used, they will be treated
in the following order:
swap/delete/replace/insert, extended, umlaute, upcase, spaces
- If input contains a prefix, --upcase will cause --spaces to fail, as the prefix
will be upcased, too.
- Arguments for --swap need to be in order of appearence otherwise --swap will fail.
- Extended options will fail on prefixes and suffixes.
Simply shorten your prefixes and suffixes.
Sollten zwei Dateien nach dem Umbenennen gleich heißen, wird das Skript sich aufhängen;. --> Einfach Strg-C zum Abbrechen.
Sollte das Skript alle Dateinamen zerschießen, einfach 'ne Runde weinen.
renamer.sh Download.
mp3gain interface
Der Hintergrund dieses Skriptes ist folgender: Wenn mp3gain auf eine Vielzahl Dateien angewandt wird, wird das mp3gain-Tag nicht in die Dateien geschrieben. Ist man später nicht mehr sicher, ob man eine Datei schon angepasst hat, muss sie neu analysiert werden. Außerdem arbeitet mp3gain nicht rekursiv.Mit diesem (einfachen) Skript werden alle Mp3's im aktuellen Ordner normalisiert, ohne daß dieser lästige Effekt auftritt.
Das Skript gibt alle Argumente an mp3gain weiter und zeigt an wie viele Dateien zu verarbeiten sind, und welche gerade verarbeitet wird.
Benötigt das Kommandozeilenprogramm "mp3gain".
mp3gain_here.sh Download.
id3convert interface
Sehr Ähnlich dem mp3gain interface. Der Grund für dieses Skript ist, daß id3convert nicht rekursiv arbeiten kann.Benötigt das Kommandozeilenprogramm "id3convert" aus der Bibliothek "id3lib".
id3convert_here.sh Download.