rename.sh
#!/bin/bash
IFS=$'\n'
ls -1 "$1"|grep "-"|cut -f2 -d"/"|cut -f1 -d"-"|uniq > list.txt
for i in $(<list.txt)
do
read -p "creer "$1"/"$i" ?" RESPONSE
if [ "$RESPONSE" = "o" ];then
echo "---->mkdir "$1/$i" puis mv "$1/$i"-* "$1/$i/""
mkdir "$1/$i"
mv "$1/$i"-* "$1/$i/"
fi
done
Thu Oct 24 19:31:39 2013 - permalink -
-
https://odea.fr/?2GRgBQ