summaryrefslogtreecommitdiff
path: root/ipl/progs/upper.icn
blob: 37d1cc7da3c380275a61bd094424b032e07c9f44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
############################################################################
#
#	File:     upper.icn
#
#	Subject:  Program to map file names to uppercase
#
#	Author:   Ralph E. Griswold
#
#	Date:     March 10, 1995
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#  This program maps the names of all files in the current directory to
#  uppercase.
#
############################################################################
#
#  Requires:   UNIX 
#
############################################################################

procedure main()
   local input, old, new

   input := open("ls", "p")

   while old := read(input) do {
      new := map(old, &lcase, &ucase)
      if new ~== old then rename(old, new)
      }

end