-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
77 lines (72 loc) · 1.14 KB
/
README
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
NOTE:
Because I blocked on the parent process, so command like cat | ping google.com, will stuck on the cat process, so pipe next
ping command will never be executed. The correct way is to make each process non-block on parent process, record the current pid
of parent process, and at the end of the procedure , traverse all the pid , wait till all the process finished.
Test:
$ sish
sish$ echo $$
6465
sish$ ls
file1 file2
sish$ ls | wc -l
2
sish$ echo $?
0
sish$ find / >/dev/null &
sish$
sish$ aed -e -p passin <file >file.enc
sish$ cmd | sort | uniq -c | sort -n
121 foo
304 bar
sish$ something
something: command not found
sish$ echo $?
127
sish$ rm /etc/passwd
rm: /etc/passwd: Permission denied
sish$ echo $?
1
sish$ exit
$ sish -c date
Sat Nov 29 21:18:07 EST 2014
$ sish -x
sish$ ls
+ ls
file1 file2
sish$ ls | wc -l
+ ls
+ wc -l
2
sish$ cd /tmp
+ cd /tmp
sish$ pwd
+ pwd
/tmp
sish$ cd
+ cd
sish$ pwd
+ pwd
/home/jschauma
sish$ exit
+ e
cd
cd ~
cd ~/Documents
cd ~nobody
exit aaa
cd ab abc
cd / /etc
abcd|efg|
ls|acg
cat|ls
ls -al >>out|cat|wc
pwd>out|cat
abcd|cat
cat|abce
cat|ping google.com
|||||
ls|cat|wc -l
ls|
ls|&cat
ls&&&
>><<<|||||&&&&&<<<