Changes

Jump to: navigation, search

OPS235 Scripting Exercises

884 bytes added, 10:22, 16 January 2020
Exercises
** Save the result in a variable, and print that variable.
* Combine the two scripts above into one. The script should tell you what the value of BOOTPROTO from /etc/sysconfig/network-scripts/ifcfg-ens33 is.
* Use the ls and wc commands to find how many log files there are in /var/log/
** Add a grep command to find how many of a certain type of log file there are (e.g. vmware-network log files)
* Use the history and grep commands to find any command you ran in the past that contained a certain keyword (like .sh or cat)
* Write a bash script which will use the whoami, hostname, date, and lvs commands to create a report.txt file containing all that information.
** Set it up so that the date (in YYYY-MM-DD format) is in the filename of the report, e.g. report-YYYY-MM-DD.txt
* Write a bash script that will ask the user for a process name, will check whether that process is running, and if it is: it will print "The process is running". If it isn't: it will print "The process is not running".
** Modify that script to include the number of processes with that name that are running.

Navigation menu