home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!pipex!warwick!nott-cs!piaggio!anw
- From: anw@maths.nott.ac.uk (Dr A. N. Walker)
- Subject: Re: Shell script poser
- Message-ID: <1992Dec14.150045.11456@maths.nott.ac.uk>
- Reply-To: anw@maths.nott.ac.uk (Dr A. N. Walker)
- Organization: Maths Dept., Nott'm Univ., UK.
- References: <724029721snx@trmphrst.demon.co.uk>
- Date: Mon, 14 Dec 1992 15:00:45 GMT
- Lines: 20
-
- In article <724029721snx@trmphrst.demon.co.uk>
- nikki@trmphrst.demon.co.uk writes:
- >Here's a little shell-script problem for all you gurus out there ...
- [wants lines lower-cased and Capitalised]
- >Can this be done using STANDARD UNIX COMMANDS ONLY (i.e. awk, tr, sed etc.)
-
- It's easy enough with "sed":
-
- sed "
- y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
- /^[a-z]/ { h
- y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
- G
- s/\(.\).*\n./\1/
- }
- " < filename
-
- --
- Andy Walker, Maths Dept., Nott'm Univ., UK.
- anw@maths.nott.ac.uk
-