Linux Redhat lab: Shell script: cấu trúc if then fi – The if-then-fi Construct



Linux Redhat lab: Shell script: cấu trúc if then fi – The if-then-fi Construct

Linux Redhat lab: Shell script: cấu trúc if then fi - The if-then-fi Construct

Link playlist
https://www.youtube.com/playlist?list=PLIpLw6v7Z1qmty_yT3KQUeV5jW46Wu7hG
2023 07 06 16 01 19

Script07: The if-then-fi Construct You saw earlier how to check the number of arguments supplied at the
command line. The following script called if_then_fi.sh determines the number
of arguments and prints an error message if there are none provided:
This script will display the following messages on the screen if it is executed
without exactly two arguments specified at the command line:
A value of 2 will appear upon examining the return code as follows. This value
reflects the exit code that you defined in the script on line 6.
Conversely, the return code will be 0 and the message will be as follows if you
supply a pair of arguments: so on.