forked from LucasKuhn/minishell_tester
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmandatory
39 lines (29 loc) · 784 Bytes
/
mandatory
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
# Prints without a new line
echo -n hello
# update env variable value
export HELLO=123
export HELLO="beautiful world"
# keep track of OLDPWD
cd obj
echo $PWD $OLDPWD
# invalid command, followed by empty input, should keep the exit code
doesntexist
echo $?
#invalid command, followed by empty variable, should clear the exit code
doesntexist
$EMPTY
echo $?
# Check if there isn't a zombie process called `cat`
echo "hi" | cat | cat | cat | cat | cat | cat | cat
ps -a
# Should skip the empty argument, and print hello after spaces
echo - "" " " hello
# Neither of these unsets should break the shell, and you should still be able to call `/bin/ls`
unset USER
unset PATH
unset PWD
/bin/ls
# This should not change the current directory
cd .. hi
# Empty `cd` moves to home
cd