Raspberry Pi_Eng_10.6.2 “||” Command – Execute Command by “or” Method


Published Book on Amazon


All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1
All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2


출판된 한글판 도서


최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)
최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)


Original Book Contents


10.6.2  "||" Command - Execute Command by "or" Method

 

This command processes the next command when the first command does not processed normally, and sets the exit status by "or" operation according to the final processing result of the both commands.

 

[Command Format]

< command-1>  ||         < command-2>

 

[Detail Description]

command-1

command-2

Exit status

exec.

result

True/False

exec.

result

True/False

operat.

final

Yes

Ok

True

No

-

-

or

True/False

Yes

Error

False

Yes

Ok/Error

True/False

or

True/False

 

If command-1 processing is "True", command-2 is not executed, and if command-1 processing is "False", command-2 is executed.

The exit status is set to "True" if at least one of the <command-1> and <command-2> exit statuses is" True", or set to "False".