[sf-lug] convert to lowercase
Alden Meneses
aldenm at gmail.com
Mon Sep 17 23:39:34 PDT 2007
Thanks all for the tr command. I forgot about that one and was trying to
figure out a way to do it with awk. You guys saved me lots of time.
Not familiar with the ex utility. Will need to read up more on it but can
you tell me why preserving the inode is important? Maybe some real world
examples of doing this method versus tr.
On 9/17/07, Michael Paoli <Michael.Paoli at cal.berkeley.edu> wrote:
>
> $ cat file
> ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
> abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
> $ ex file << \__EOT__
> > %s/[A-Z]/\l&/g
> > w
> > q
> > __EOT__
> $ cat file
> abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz
> abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz
> $
>
> One of the advantages of the method shown above, is that it
> preserves the inode and (hard) link relationships (and ownerships
> and permissions) of the file - no explicit intermediary file required.
>
> Extra credit: name a disadvantage with the above (hint: multiuser,
> multitasking)
>
> Quoting Alden Meneses <aldenm at gmail.com>:
>
> > I was wondering if anyone knew how to convert a text file to all
> lowercase.
>
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxmafia.com/pipermail/sf-lug/attachments/20070917/ea966d9f/attachment.html>
More information about the sf-lug
mailing list