Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9556a1c9e3 | |||
| d72a717700 | |||
| a80f7fea3b |
20
script.sh
Normal file
20
script.sh
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
# la redéfinition de l'IFS permet de gérer correctement les fichiers avec des espaces dans le nom
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
# /foo/bar sera renommé en /Foo/bar
|
||||||
|
# Pour bien faire il faudrait séparer le chemin du nom du fichier
|
||||||
|
if [ $# -lt 1 ] ; then
|
||||||
|
echo "gimme at least one file"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# file = Test/fichier1
|
||||||
|
|
||||||
|
for file in "$@" ; do
|
||||||
|
dn=$(dirname $file)
|
||||||
|
bn=$(basename $file)
|
||||||
|
test -f "$file" || continue
|
||||||
|
mv $file ${dn}/${bn^}
|
||||||
|
done
|
||||||
0
test/Fichier 6
Normal file
0
test/Fichier 6
Normal file
0
test/Fichier1
Normal file
0
test/Fichier1
Normal file
0
test/Fichier2
Normal file
0
test/Fichier2
Normal file
0
test/Fichier3
Normal file
0
test/Fichier3
Normal file
0
test/Fichier4
Normal file
0
test/Fichier4
Normal file
0
test/Fichier5
Normal file
0
test/Fichier5
Normal file
Reference in New Issue
Block a user