a You type in echo into the terminal and it prints out 127
(a) You type in echo $? into the terminal and it prints out 127. Did the command you entered immediately before echo $? execute successfully? If not, state the reason for the error.
(b) You have a script called hello.sh in your home directory. Write a command to give yourself the permissions to execute the file ~/hello.sh, without changing the existing permissions of ‘others’
Solution
(a)
# use export to assign 127 to var
export var=127
# display value of var -> 127
echo $var
# no error occured
(b)
# change permission of file
chown -R User filename
# user: ubuntu. filename: hello.sh
chown -R ubuntu hello.sh
# ececute file
./hello.sh
