home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / shell / 5056 < prev    next >
Encoding:
Text File  |  1992-12-14  |  962 b   |  32 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!pipex!warwick!nott-cs!piaggio!anw
  3. From: anw@maths.nott.ac.uk (Dr A. N. Walker)
  4. Subject: Re: Shell script poser
  5. Message-ID: <1992Dec14.150045.11456@maths.nott.ac.uk>
  6. Reply-To: anw@maths.nott.ac.uk (Dr A. N. Walker)
  7. Organization: Maths Dept., Nott'm Univ., UK.
  8. References: <724029721snx@trmphrst.demon.co.uk>
  9. Date: Mon, 14 Dec 1992 15:00:45 GMT
  10. Lines: 20
  11.  
  12. In article <724029721snx@trmphrst.demon.co.uk>
  13. nikki@trmphrst.demon.co.uk writes:
  14. >Here's a little shell-script problem for all you gurus out there ...
  15.     [wants lines lower-cased and Capitalised]
  16. >Can this be done using STANDARD UNIX COMMANDS ONLY (i.e. awk, tr, sed etc.)
  17.  
  18.     It's easy enough with "sed":
  19.  
  20. sed "
  21.     y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
  22.     /^[a-z]/ { h
  23.            y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
  24.            G
  25.            s/\(.\).*\n./\1/
  26.          }
  27. " < filename
  28.  
  29. -- 
  30. Andy Walker, Maths Dept., Nott'm Univ., UK.
  31. anw@maths.nott.ac.uk
  32.