HELP converting filenames!

Bob Lenk rml at hpfcdc.HP.COM
Wed Oct 11 10:07:25 AEST 1989


Having seen a few postings with lines like:

>	mv $old `echo $old | tr A-Z a-z`

I thought it worth pointing out that tr syntax is different in BSD and
SysV systems.  In System V this command line will only convert A and Z
characters to lower-case, leaving B-Y untouched.  The SysV (and POSIX.2
Draft 9) syntax is

	mv $old `echo $old | tr '[A-Z]' '[a-z]'`

While I'm at it, note that both SysV and BSD echo will do strange
things with certain filenames ( -n for BSD, names with backslashes
for SysV).  This can be avoided with a here-document.

		Bob Lenk
		rml at hpfcla.hp.com
		hplabs!hpfcla!rml



More information about the Comp.unix.wizards mailing list