-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
COMMAND.COM
executable file
·66 lines (60 loc) · 946 Bytes
/
COMMAND.COM
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
#!/bin/bash
# cp to /bin
# and add to /etc/shells
# use chsh to change the shell for users
# rd/md/set
# rm > del
# cat > type
# mkfs > format
# fsck > chkdsk
# https://en.wikipedia.org/wiki/Abort,_Retry,_Fail%3F
# https://en.wikipedia.org/wiki/List_of_DOS_commands
#
export PS1="C:\\>"
ver=3.30
while (sleep 0); do
echo -n $PS1
read n
case $n in
?:)
echo "Drive $n does not exist."
echo
;;
cd\ *)
$n
export PS1="C:"$(echo $PWD | sed "s,/,\\\,g"|tr '[:lower:]' '[:upper:]')">"
;;
dir*)
ls -1
;;
ver*/?)
echo "View and set the reported DOS version."
echo
echo "VER"
echo
;;
ver)
echo "DOS version $ver."
echo
;;
cls*/?)
;;
cls)
clear
;;
mem)
free -m
;;
exit)
exit 0
;;
ls*|pwd|mem)
echo Illegal command: $n.
;;
*)
if [ ! "${n}x" = x ]; then
which $n &>/dev/null && $n || echo "Illegal command: $n."
fi
;;
esac
done