shell Introduction to programming #!/bin/sh #The function used to compare the two numbers vara=$1
varb=$2 if [ -z $vara ] || [ -z $varb ] then echo "please input hte two
numbers" exit 1 fi if [ $vara -eq $varb ] ; then echo "the $vara = $varb" else
if [ $vara -gt $varb ] then echo "the $vara > $varb" elif [ $vara -lt $varb ]
then echo "the $vara < $varb" fi fi

[root@localhost sourcetemp]# ./compare 1 2
the 1 < 2

[root@localhost sourcetemp]# ./compare 4 3
the 4 > 3

[root@localhost sourcetemp]# ./compare 3 3
the 3 = 3

Need attention :

1.#!/bin/bash finish writing sth. #!bin/bash Resolution not found

2.#!/bin/bash Can be written as #!/bin/sh sh connection to bash

3.if [ $var -eq $varb ] ; then

All have spaces

 

Technology
©2019-2020 Toolsou All rights reserved,
CSS architecture design NOI2019 travels Detailed explanation ubuntu14.04 How to set static IP2019 Year end summary —— Second year of work Big data tells you , How tired are Chinese women java Simple lottery algorithm , luck draw DemoPYTHON Summary of final review Classical algorithm - recursion ( The case of raw rabbit )2021 year 1 Monthly programmer salary statistics , average 14915 element First knowledge python Skills summary