-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest1.script
80 lines (77 loc) · 1011 Bytes
/
test1.script
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//************** simple test: format, create, write, read, readdir
format
pwd
create /junk
ls /
write /junk this is file junk
read /junk
ls .
read junk
writeln junk
two
lines
.
read junk
//*************** mkdir, chdir, symlink, readlink
mkdir dir1
mkdir dir1/subdir
ls /
create dir1/subdir/foo
cd dir1
pwd
ls subdir
cd subdir
pwd
cd ..
pwd
writeln subdir/foo
This is foo
.
read subdir/foo
// Absolute symlink
ln /dir1/subdir/foo link1
readlink link1
read link1
readlink /dir1/link1
read /dir1/link1
// Relative symlink
ln ../dir1 link2
readlink link2
ls ../dir1
ls link2
ls link2/subdir
read link2/subdir/foo
read /dir1/link2/subdir/foo
//**************** rmdir delete
ls .
rmdir subdir
rm subdir/foo
rmdir subdir
rm link1
ls
pwd
//Q9
format
mkdir /dir
cd /dir
pwd
rmdir /dir
cd ..
rmdir /dir
//Q10
format
mkdir /foo
create /foo/bar
write /foo/bar This is file /foo/bar
read /foo/bar
read foo/bar
read foo/bar/
read foo//bar
read //foo///bar////
//Q11
format
mkdir /tmp
cd /tmp
ln /tmp/bad bad
cd bad
rm bad