Apologies to jump in here with such a lengthy post.
Quote:
Originally Posted by bakunin
This (and more) is discussed in a book i can heartily recommend: Advanced Programming in the UNIX Environment by W. Richard Stevens. One of the best books ever written about programming.
And I heartily agree with that.
However, that 700-page tome might not be the best place for shell scripting practices. If one is interested in shell programming, the following books are some that we discussed in classes that I lead, and that I have in my library (and there are other, newer books, as well):
Best wishes ... cheers, drl
Code:
Title: Classic Shell Scripting
Subtitle: Hidden Commands that Unlock the Power of Unix
Author: A Robbins, N Beebe
First Edition: May 2005
Publisher: O'Reilly
ISBN 10: 0-596-00595-4
Pages: 558
Categories: scripting, shell, programming
Comments: 4.5 stars, 37 reviews Amazon (2015.08)
Title: UNIX(R) Shells by Example
Subtitle: ... guide to the C, Bourne, and Korn Shells plus Awk, Sed, and Grep
Author: Ellie Quigley
Edition: 4th
Date: 2004
Publisher: Prentice-Hall
ISBN: 013147572X
Pages: 1200
Categories: sh, csh, ksh, grep, sed, awk, scripting, shell, programming
Comments: 4.5 stars, 45 reviews Amazon (2007.07)
Comments: ( I have 2nd Ed, 1997 )
Comments: ( 4th edition includes bash and tcsh chapters )
Title: The Art of UNIX Programming
Author: Eric S Raymond
Edition: first
Date: 2003
Publisher: Addison-Wesley Professional
ISBN: 0131429019
Pages: 512
Categories: design, history, unix, linux, programming, development wisdom
Comments: History, principles, guidelines.
Comments: 4 stars (32 reviews, Amazon 2007.11)
Comments: HTML version at http://catb.org/esr/writings/taoup/
Title: Learning the bash Shell
Author: Cameron Newham
Edition: Third
Date: 2005
Publisher: O'Reilly
ISBN: 0596009658
Pages: 376
Categories: bash, scripting, unix, linux, shell, programming
Comments: 4.1 stars, 39 reviews (Amazon 2015.08)
Comments: ( I have 2nd edition, 1998 )
Comments: "bashdb", bash debugger, Chapter 9.
Title: Unix Programming Environment
Author: Brian W. Kernighan, Rob Pike
Edition:
Date: 1984
Publisher: Prentice Hall
ISBN: 013937681X
Pages: 357
Categories: programming, development, software engineering
Comments: 4.5 stars (64 reviews, 2017.09) at Amazon
Title: bash Cookbook
Subtitle: Solutions and Examples for bash Users
Author: Carl Albing, JP Vossen, Cameron Newham
Edition: 1st
Date: 2007
Publisher: O'Reilly
ISBN: 0596526784
Pages: 622
Categories: bash, scripting, unix, linux, shell, programming
Comments: 4.3 stars Amazon (28 reviews, 2015.08)
Note that The Art of UNIX Programming can be read on-line. For example, this chapter: Taxonomy of Unix IPC Methods
Stevens' book is available in Kindle format.
The bash Cookbook was co-written by a Cray employee with whom I worked and coincidently lives nearby.
The Unix Programming Environment is still in print, even after 30 years !
well I found lot of topics about awk..about if command in awk..
but I had to implement this:
nawk -F"|" '
$47 ~ /0R0011/ { print > ("/home/user/M/MC.tmp" )}
$47 ~ /0R0012/ { print > ("/home/user/M/DuSI.tmp" )}
$47 ~ /0R0014/ { print > ("/home/user/M/FF.tmp" )}
$47 ~ /0R0018/ { print >... (9 Replies)
Im new to unix and shell scripting. I am required to write a program and im in the process of creating a menu system. I have my main menu but i want to be able to select an option that takes me onto another menu. I have tried doing this with the case statement with no luck so far. Wondering if it... (3 Replies)
Hi all,
I would like to ask whether in Unix shell/perl have any functions or command to allow grep/cat/read a file inside compressed .tgz without extract it?
I know we can tar tvf a compressed tgz but this only allow we read the path/filename contained inside the tarball. If we want to read... (3 Replies)
echo "please enter ur choice..
1. Make a file.
2. Display contents
3. Copy the file
4. Rename the file
5. Delete the file
6. Exit"
read choice
case $choice in
1 ) echo enter the file name
read fname
if
then
echo... (2 Replies)
i have a case statement which branches to different sections based on an input. Each branch needs to call a function. below is the code. FOr some reason, the code inside the function is not getting executed. the code is below for reference.
in the below code echo "Function 1" which is there... (2 Replies)
please let me know if the below code could be written efficiently inside single awk
case "$INP" in
ksh)
cat catalog | awk 'BEGIN {FS=",";} { print $2 } END {}'
;;
pset)
cat catalog | awk 'BEGIN {FS=",";} { print $3 } END {}'
;;
dml)
cat catalog | awk 'BEGIN {FS=",";} {... (2 Replies)
I need to Write a shell script that allows some system-administration tasks to be preformed automatically from a menu-driven interface. with automated following tasks:
Copy directory tree
Delete files or directories
Output Information (this part is done )
*Copy directory tree
The “Copy... (2 Replies)
Hi,
I am reading file records inside a while loop,
and want to update the record when certain condition is met.
How can I update a file while being read?
I want to avoid using temporary files, copy, rename, ...
while IFS=',' read -r f1 f2
do
function(f1,f2)
if
then
<add... (1 Reply)
Hello,
I have a problem. I want to launch a different sql queries for different shell parameter values, something like this.
#/bin/bash
case $1 in
"A")
sqlplus -s user/pass << SQL
query A;
SQL
"B") sqlplus -s user/pass << SQL2
... (3 Replies)