0% found this document useful (0 votes)
3 views15 pages

Shell 21 Scripts

Uploaded by

buvanaa2502
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views15 pages

Shell 21 Scripts

Uploaded by

buvanaa2502
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

Write a script to check whether a given number is odd or even

Output :

2. Write a script to check if a person’s age is less than 18, then consider person as
“Kid”, if person’s age is between 18 to 60, then consider a person as “Adult” else
consider them as “Senior citizen”
Output :

3. Write a script to print pyramid.

Output :

4. Write a script to print even number from 1-20 using for, while, until loop
For loop
Output :

While loop

Output :
Until loop

Output :

5. Write a script to read the account balance and print “non-veg party” if amount is
more than 1000, print pizza party if amount is more than 500 and less than or equal to
1000 and print “tea party” if then amount is less than or equal to 500 or greater than
10 and then print “no party” if amount is less than or equal 10 and greater than or
equal to zero .
Output :

6. Write a script to check whether a tool exists; if the tool doesn't exist, then install it.

Output :
7. Write a script to automatically delete all created users except the default ones.

Output :
8. Write a script to create users automatically.

Output :
9. Write a script to create a backup file for data (using top command).
Output :

[Link] a script to check if a user exists or not.

Output
11. Write a script to start a service.

Output :
12. Monitor CPU usage: Write a script that checks CPU usage every 5 seconds and logs it
into a fi

Script14: To create users from a given text file


Script15: To replace a keyword

Script16: Create Backup for CUP performance & delete the log files older than 7 days

Script17: Check if Docker is present or not, If present then check if it is in running or stopped state.
Script18: To Monitor Disk Usage and if it is greater than 80% send alert

Script19: To push changes in GitHub Repository with a custom message

Script20: To check if the given website is online or offline

Note: Install Curl package before executing


Script21: To list the top 5 running processes

You might also like