Bash scripts for Systems Administration
Reynerio Samos
Assignment Set Given : SEPT 26, 2024
Ones to be checked will be: 4, 5, 6, 10
-
The simplest Hello World shell script
echo Command
hello_world.sh
-
[] Summation of two integers
if block
sum_int.sh
-
[] Summation of two real numbers
bc (basic calculator) command
sum_real.sh
-
Script to find out the biggest number in 3 numbers
if -elif block
biggest.sh
-
Operation (summation, substraction, multiplication and division) of two numbers
switch
operation.sh
-
Script to reverse a given number
while block
reverse.sh
-
[] A more complicated greeting shell script
no stated method
greeting.sh
-
[] Sort the given five numbers in ascending order (using array)
do loop
sort_asc.sh
-
[] Calculating average of given numbers on command line arguments
do loop
avg.sh
-
Calculating factorial of a given number
while block
factorial.sh
-
[] An application in research computing
combining all above
research.sh
Create a shell script that takes in three integers. The script is to calculate the product and sum of the integers and also arrange them in ascending order
threenums.sh
Create a shell script that request a string of text and a number. The script should print the string of text the given number of times only when the number is between 5 and 20; otherwise it should display an appropriate message.
printstring.sh
-
Write a shell script that accomplishes the following tasks:
a.) Accept a file name from the command line that represents a text file that contains first and last names. And accepts a second command line argument that contains the last name that the user wants to find.
b.) Your script should use a regular expression to get all the names(lines) in the file that have the requested last name.
Example run: Assume names.txt is found and it contians the following names below. (add at least 6 more names to the file)
Jane Smith
Hope Peters
Peter Smith
Pam Peters
$ my-lookup names.txt Peters
Hope Peters
Pam Peters
Goodbye!