Mastering Unix Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus

Mastering Unix Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus

Randal K. Michael

Language: English

Pages: 847

ISBN: 2:00050391

Format: PDF / Kindle (mobi) / ePub


UNIX expert Randal K. Michael guides you through every detail of writing shell scripts to automate specific tasks. Each chapter begins with a typical, everyday UNIX challenge, then shows you how to take basic syntax and turn it into a shell scripting solution. Covering Bash, Bourne, and Korn shell scripting, this updated edition provides complete shell scripts plus detailed descriptions of each part. UNIX programmers and system administrators can tailor these to build tools that monitor for specific system events and situations, building solid UNIX shell scripting skills to solve real-world system administration problems.

 

 

 

 

 

 

 

 

 

 

 

verify that each value in the list is either an integer or a floating-pointing number. Look at the code segment shown in Listing 13-2. Listing 13-2: Testing for integers and floating-point numbers # Check each number supplied to ensure that the “numbers” # are either integers or floating-point numbers. for NUM in $NUM_LIST do case $NUM in +([0-9])) # Check for an integer : # No-op, do nothing. ;; +(-[0-9])) # Check for a negative whole number : #

correct this problem and regain your memory is to reboot the system, most of the time. Notice at the end of the script that there is a test to see if the percentage of paging space used is greater than or equal to the limit that is set by the PC_LIMIT variable. If the value is exceeded, then reverse video is turned on so the WARNING message stands out on the screen. After the message is displayed, reverse video is turned back off. To turn on reverse video use the tput smso command. When

19-13: iostat_loadmon.ksh shell script in action The Operating System is Linux Gathering CPU Statistics using vmstat… There are 2 sampling periods with each interval lasting 300 seconds …Please wait while gathering statistics… User part is 39.35% Nice part is 0.00% System part is 31.59% Idle time is 29.06% Notice that the output is in the same format as the sar script output. This is all there is to the iostat shell script. Let's now move on to the

the /.profile default prompt PS1=“$THISHOST:broot> ” export PS1 #################### RUN IT HERE ########################## chmod 600 ${LOGDIR}/${LOGFILE} # Change permission to RW for the owner script ${LOGDIR}/${LOGFILE} # Start the script monitoring session chmod 400 ${LOGDIR}/${LOGFILE} # Set permission to read-only for the owner cleanup_exit # Execute the cleanup and exit function There is one extremely important difference between this script and

function queries the system for the UNIX flavor. ???Author: Are descriptions to come for these?load_AIX_FS_data This function loads AIX filesystem data. load_HP_UX_FS_data This function loads HP-UX filesystem data. load_LINUX_FS_data This function loads Linux filesystem data. load_OpenBSD_FS_data This function loads OpenBSD filesystem data. load_Solaris_FS_data This function loads Solaris filesystem data. Chapter 18 There are no functions to list in

Download sample

Download