What is displayed when this sequence of commands is executed using the bash shell?

Consider the following commands:

What is displayed when this sequence of commands is executed using the bash shell?

Consider the following commands:

What is displayed when this sequence of commands is executed using the bash shell?

A.
Hello, world

B.
cat: cannot open file1: No such file or directory Hello, world

C.
cat: cannot open file1: No such file or directory

D.
bash: syntax error near unexpected token ‘| |’

E.
bash: syntax error broker pipe

Explanation:
Reference: Bash Reference Manual, Lists of Commands



Leave a Reply 6

Your email address will not be published. Required fields are marked *


ennnot

ennnot

# rm ./file1
rm: ./file1: No such file or directory
# echo “Hello, world” > ./file2
# cat ./file1 || ./file2
cat: cannot open ./file1: No such file or directory
-bash: ./file2: Permission denied
#
Answer: C

max

max

# cat ./file1 || ./file2 is not correct
Сarefully read the question

suhaimi

suhaimi

just try… B is correct

# cat ./file1 || ./file2
missing cat on ./file2
suppose to be # cat ./file1 || cat ./file2

Armen

Armen

B is correct answer

max

max

B is correct answer

Traid on virtual machine with Solaris 11

~/tmp# rm file1
~/tmp# echo “Hello, World” > file2
~/tmp# cat file1 || cat file2
cat: cannot open file1: No such file or directory
Hello, World
~/tmp#

DK

DK

B is correct answer

Test on VM soloaris 11

root@solaris11 #touch file1
root@solaris11 #touch file2
root@solaris11 #rm file1
root@solaris11 #echo “Hello, world” >file2
root@solaris11 #cat file1 ||cat file2

cat: cannot open file1: No such file or directory
Hello, World

root@solaris11 #