Hi, Anfang: Linux-Kiste hat kein CDROM - eNTe schon - ich will nun die CD per WAR-NFS von der eNTe freigeben. Allerdings rafft die eNTe mal wieder die Buchstabengroesse nicht... d.h. er zeigt alle Datei- und Verzeichniss-Namen in Grossbuchstaben an. Daher erkennt Yast seine über NFS gemountete CD nicht. Ich habe daher die 1.CD auf Platte der eNTe kopiert und wollte nun dieses Verzeichnis per NFS mounten und per Perl- oder Shellscript die Namen auf Kleinbuchstaben aendern. Frage: Wie macht man so was am besten? Mit Regex? Oder gibts schon UpperToLower oder so was ? Danke, Martin --------------------------------------------------------------------- To unsubscribe, e-mail: suse-linux-unsubscribe@suse.com For additional commands, e-mail: suse-linux-help@suse.com
Hi, On Thu, Feb 10, 2000 at 15:56 +0000, Martin Haller wrote:
Ich habe daher die 1.CD auf Platte der eNTe kopiert und wollte nun dieses Verzeichnis per NFS mounten und per Perl- oder Shellscript die Namen auf Kleinbuchstaben aendern.
Frage: Wie macht man so was am besten? Mit Regex? Oder gibts schon UpperToLower oder so was ?
Versuch's mal mit for x in `find -depth -type d`; do (cd "$x"; mmv -r "*" "#l1"); done Ciao, Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: suse-linux-unsubscribe@suse.com For additional commands, e-mail: suse-linux-help@suse.com
On Thu, 10 Feb 2000, Martin Haller wrote: [daemliche eNTe]
Ich habe daher die 1.CD auf Platte der eNTe kopiert und wollte nun dieses Verzeichnis per NFS mounten und per Perl- oder Shellscript die Namen auf Kleinbuchstaben aendern.
Frage: Wie macht man so was am besten? Mit Regex? Oder gibts schon UpperToLower oder so was ?
Zwei Klippen: 1. Wenn der Dateiname im Original klein ist, dann würde ein mv zu einem Fehler führen (Original und Kopie sind identisch). Also Dateien erst prüfen. 2. Wenn man rekursiv arbeitet und ein Verzeichnis umbenennt bevor man die darin enthaltenen Dateien anfasst, dann sägt man den dann folgenden Dateinamen den Ast ab (mv /KLEIN /klein geht noch, aber dann kann ein mv /KLEIN/DATEI /klein/datei nicht mehr klappen). Also Option -depth für den find. # Script ren_file: Datei umbenennen klein=`dirname $1`/`basename $1 | tr [:upper:] [:lower:]` test $1 = $klein || mv $1 $klein # Aufruf: find basis_dir -depth -exec ren_file {} \; Jan --------------------------------------------------------------------- To unsubscribe, e-mail: suse-linux-unsubscribe@suse.com For additional commands, e-mail: suse-linux-help@suse.com
participants (3)
-
haller@desaga-gmbh.de
-
Jan.Trippler@t-online.de
-
stefan.troeger@wirtschaft.tu-chemnitz.de