[K12OSN] winbind/gdm issues

Les Mikesell les at futuresource.com
Fri Aug 27 20:55:39 UTC 2004


On Fri, 2004-08-27 at 14:51, Huck wrote:
> could you break down the expression so I can modify for other uses as well?
> 
> both the  
> 
> :%s/.*/\L&/g

:  starts an ex-mode (command-line at the bottom) command
%  short for 1,$ or first to last line
s  substitute
/  start of match
.  match any character
*  match any number of the previous
/  end match, start replacement
\L special-case lowercase directive
&  what the match pattern matched
/  end replacement
g  global within line (all occurrences)


> and 
> 
> 1G!Gtr '[A-Z]' '[a-z]'

1G  go to 1st line
!   filter range through external program
G   end line is end of range to filter
tr  one of the tradition unix tools with its own man page
'[A-Z]'  the 'match' pattern for tr (the range of uppercase)
'[a-z]'  the replacement set for tr

tr (transliterate) handles this a little differently than
regexp based matches.  It will expand the A-Z into the
complete range as one string, a-z into another and
transliterate the characters in the input into the
character in the corresponding position in the replacement.
You could do this with completely arbitrary strings
instead of ranges like this if you wanted.

---
  Les Mikesell
   les at futuresource.com






More information about the K12OSN mailing list