From 50638cc187944e048ae72eb32c3cda36c41889d8 Mon Sep 17 00:00:00 2001 From: simono41 Date: Fri, 23 Mar 2018 01:17:41 +0100 Subject: [PATCH] rename-script --- mv_dir.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 mv_dir.sh diff --git a/mv_dir.sh b/mv_dir.sh new file mode 100755 index 0000000..c203581 --- /dev/null +++ b/mv_dir.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +stichwort="$1" + +while (( "$#" )) +do + + cd "${1%/*}" # gehe ins Verzeichnis + + FILENAME=${1##*/} # Dateiname ist alles ab dem letzten '/' + echo "$FILENAME" + # guck dir die Ausgabe erstmal an - wenn alles passt kannst Du das "echo" weglassen + mv "$FILENAME" "${FILENAME%-*}" + + shift + cd - +done + +#mv_dir.sh /*master