Linux script exercises
Example 1: write a script and use the loop and continue keywords to calculate the sum of the three divisible numbers within 100
Running result:
Example 2: write a script and use the loop and continue keywords to calculate the sum of the three divisible numbers within 100
Running result:
Example 3: write a script to download the tar.gzor tar.bz2 file.
Running result:
Example 4: write a script to help you query rpm information. This script first prompts the user to select the query basis, such as the file name, package name, and all. Then, the user is prompted to select the query information, such as the package name, all files contained in the package, and package information. Then ask if you want to continue the query.
#! /Bin/shcase ${1 # *. tar.} in bz2) tar jxvf $1; gz) tar zxvf $1; *) echo "wrong file type" esac