-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
executable file
·51 lines (48 loc) · 1.13 KB
/
script.sh
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
#!/bin/zsh
rm ~/.mpshrc 2> /dev/null
PATH=$PATH:$PWD
echo "mkdir test
cd test
touch file1 file2
ls ./ not 1> file1 2> file2
cat file1 file2
rm file1 file2
ls ./ not 1> file1 2> file2
cat file1
ls | wc
rm file1 file2
echo done
exit 0
" | mpsh > file1
echo "~/.mpshrc not found.
Creation of a default .mpshrc
The default content is
export CHEMIN=\$PATH
INVITE=\"[\\\u@\\h : \\W]$ \"
~/.mpshrc created.
Execution of the ~/.mpshrc script.
~/.mpshrc successfully executed.
[$USER@$HOST : mpsh]$ mkdir test
[$USER@$HOST : mpsh]$ cd test
[$USER@$HOST : test]$ touch file1 file2
[$USER@$HOST : test]$ ls ./ not 1> file1 2> file2
[$USER@$HOST : test]$ cat file1 file2
./:
file1
file2
ls: impossible d'accéder à 'not': Aucun fichier ou dossier de ce type
[$USER@$HOST : test]$ rm file1 file2
[$USER@$HOST : test]$ ls ./ not 1> file1 2> file2
[$USER@$HOST : test]$ cat file1
./:
file1
file2
[$USER@$HOST : test]$ ls | wc
2 2 12
[$USER@$HOST : test]$ rm file1 file2
[$USER@$HOST : test]$ echo done
done
[$USER@$HOST : test]$ exit 0" > file2
rm -r test
diff -y -a --report-identical-files --color --suppress-common-lines file1 file2
rm file1 file2