Download E-books Wicked Cool Shell Scripts: 101 Scripts for Linux, OS X, and UNIX Systems PDF

By Dave Taylor

All desktops working Linux, Mac OS X, or Unix-like working platforms have a command line interface that offers clients a robust substitute to coping with their pcs and studying programming fundamentals. clients can write small courses, or scripts, that run within the command line "shell" to accomplish daily projects like renaming documents or processing text.

Like the best-selling first variation, this revision of Wicked Cool Shell Scripts presents the entire resource code for over a hundred brief shell scripts that clear up universal difficulties, can be utilized to customize a user's computing surroundings, and are only undeniable unique. The instruments contain an interactive calculator, a inventory tracker, a password supervisor, a climate checker, and an internet site seek engine.

This revision contains 22 brand-new scripts, a brand new bankruptcy on image-processing, and a set of scripts to paintings with cloud-based prone like Dropbox and iCloud.

Show description

Read Online or Download Wicked Cool Shell Scripts: 101 Scripts for Linux, OS X, and UNIX Systems PDF

Best Linux books

RHCSA/RHCE Red Hat Linux Certification Study Guide, Seventh Edition (Exams EX200 & EX300)

In response to crimson Hat firm Linux 7, the hot version of this bestselling examine advisor covers the up-to-date crimson Hat qualified approach Administrator (RHCSA) and crimson Hat qualified Engineer (RHCE) assessments. RHCSA/RHCE crimson Hat Linux Certification research advisor, seventh version is totally revised to hide the lately published pink Hat company Linux 7 and the corresponding RHCSA and RHCE certification checks.

Linux (Hacking Exposed)

Tighten holes and preserve safety in your Linux procedure! From one of many authors of the foreign best-seller, Hacking uncovered: community defense secrets and techniques & suggestions, comes a must have safeguard guide for somebody operating Linux. This state of the art volu

Advanced Linux Networking

With increasingly more networks and mission-critical functions operating on Linux, procedure, and community directors has to be capable of do greater than organize a server and depend upon its default configuration. this article is designed that can assist you in attaining the next point of competence. It makes a speciality of strong thoughts and lines of Linux networking and gives you with the information you must enhance server potency, improve safety, and adapt to new necessities.

Guide to Assembly Language Programming in Linux

Introduces Linux innovations to programmers who're conversant in different working platforms equivalent to home windows XP offers entire insurance of the Pentium meeting language

Extra info for Wicked Cool Shell Scripts: 101 Scripts for Linux, OS X, and UNIX Systems

Show sample text content

Booklet web page 167 Monday, December 15, 2003 11:27 AM The Code #! /bin/sh # connecttime - studies cumulative connection time for month/year entries # present in the procedure log dossier. For simplicity, this is often an awk application. log="/var/log/system. log" tempfile="/tmp/$0. $$" # this can be simply /var/log/system on a few machines seize "rm $tempfile" zero cat << 'EOF' > $tempfile commence { lastmonth=""; sum = zero } { if ( $1 ! = lastmonth && lastmonth ! = "" ) { if (sum > 60) { overall = sum/60 " hours" } else { overall = sum " mins" } print lastmonth ": " overall sum=0 } lastmonth=$1 sum += $8 } finish { if (sum > 60) { overall = sum/60 " hours" } else { overall = sum " mins" } print lastmonth ": " overall } EOF grep "Connect time" $log | awk -f $tempfile go out zero the way it Works On such a lot Unixes, the procedure log dossier comprises log entries from the PPP (Point-toPoint Protocol) daemon. Here’s an instance of a log snippet from a Mac OS X procedure, taking a look at /var/log/system. log: $ grep Jul 12 Jul 12 Jul 12 pppd /var/log/system. log 10:10:57 localhost pppd[169]: Connection terminated. 10:10:57 localhost pppd[169]: attach time 2. 1 mins. 10:10:57 localhost pppd[169]: despatched 15009 bytes, bought 387811 bytes. net an d I nt er ne t U se rs 167 wcss_book03. e-book web page 168 Monday, December 15, 2003 11:27 AM Jul 12 10:11:11 localhost pppd[169]: Serial hyperlink disconnected. Jul 12 10:11:12 localhost pppd[169]: go out. there are many attention-grabbing statistics during this snippet, most significantly the particular attach time. Slice these attach time strings out of the log dossier, upload them up, and you’ve bought your cumulative attach time for the month. This script makes sense sufficient to calculate month-by-month totals no matter if you don’t rotate your logs (though you want to; see Script #55, Rotating Log documents, for info on the right way to accomplish this rather easily). This script is basically only a tremendous awk application that tests month values within the process. log entries to understand how you can mixture attach time. while $1, the month box within the log dossier output, isn't the same as lastmonth, and lastmonth isn’t the empty string (which it really is whilst the script starts examining the log file), the script outputs the amassed time for the former month and resets the accumulator, sum, to 0: if ( $1 ! = lastmonth && lastmonth ! = "" ) { if (sum > 60) { overall = sum/60 " hours" } else { overall = sum " mins" } print lastmonth ": " overall sum=0 } the remainder of this system might be elementary examining. certainly, awk courses may be very transparent and readable, that's one cause i admire utilizing awk for this kind of job. be aware convenient discount rates tip The dial-up account i exploit with Earthlink has 5 hours per 30 days pay as you go, so this application is helping make sure that i do know whilst I exceed that and am going to be charged by means of the hour for added attach time. It’s really important for minimizing these per 30 days dial-up debts! operating the Script This script has no arguments, although it's possible you'll have to tweak it to make sure that it’s pointing to the log dossier in your specific process that documents ppd output messages.

Rated 4.66 of 5 – based on 6 votes