blob: 04ca09c638253ac898d30c0761bac0edc92db635 (
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
37
38
39
40
41
|
############################################################################
#
# File: cwd.icn
#
# Subject: Program to write current working directory
#
# Author: Ralph E. Griswold
#
# Date: June 10, 1994
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# This program write the current working directory, shorn of it's
# path specification.
#
# For appropriately named directories, it can be used as, for example,
#
# ftp `cwd`
#
############################################################################
#
# Requires: UNIX
#
############################################################################
procedure main()
local i
read(open("pwd", "p")) ? {
i := 0 # for safety
every i := upto('/') # expect full path
tab(i + 1)
write(tab(0))
}
end
|