#!/usr/bin/perl -w
use strict;
my @files;
@files = `find . -type f -maxdepth 1`;
my $file;
foreach $file(@files) {
chomp($file);
print "$file -> \U$file\n";
my $command = "/bin/mv $file \U$file";
`$command`;
}
mv -i $f $(echo $f | tr /a-z/ /A-Z/)
$ ls -1
a
abc
aBc
b
c
xYZ
ZZZ
$ for f in * ; do mv -i $f $(echo $f | tr /a-z/ /A-Z/) ; done
mv: ,,ABC" überschreiben? n
mv: ,,ZZZ" und ,,ZZZ" sind die gleiche Datei
$ ls -1
A
aBc
ABC
B
C
XYZ
ZZZ
Bucki schrieb:Habe ich das jetzt richtig als Shellskript erkannt :?:
Das fängt an, richtig interessant zu werden
... dann kann's ja draussen ruhig noch ein bischen weiterschneien und schmuddeln
$ for f in * ; do mv -i $f $(echo $f | tr /a-z/ /A-Z/) ; done