Sponsored Content
Full Discussion: Case inside While read File
Top Forums UNIX for Beginners Questions & Answers Case inside While read File Post 303008205 by drl on Tuesday 28th of November 2017 02:16:26 PM
Old 11-28-2017
Hi.

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 !

( Edit 1: correct minor grammar error. )

Last edited by drl; 12-04-2017 at 09:47 AM..
These 4 Users Gave Thanks to drl For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

case command inside awk/nawk

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)
Discussion started by: abdulaziz
9 Replies

2. Shell Programming and Scripting

Case inside case?

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)
Discussion started by: RAFC_99
3 Replies

3. UNIX for Advanced & Expert Users

how to grep/read a file inside compressed tgz without extract?

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)
Discussion started by: mayshy
3 Replies

4. Shell Programming and Scripting

multiple lines inside a case statement

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)
Discussion started by: gotam
2 Replies

5. UNIX for Advanced & Expert Users

how to read a file inside jar

how to read the text file inside the jar without extracting jar. (3 Replies)
Discussion started by: karthikn
3 Replies

6. Shell Programming and Scripting

Call function inside CASE

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)
Discussion started by: cvsanthosh
2 Replies

7. Shell Programming and Scripting

Nested case inside awk

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)
Discussion started by: cvsanthosh
2 Replies

8. Homework & Coursework Questions

How to read user keyboard input inside the case?

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)
Discussion started by: femchi
2 Replies

9. Shell Programming and Scripting

Update file record inside read loop

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)
Discussion started by: ysrini
1 Replies

10. Shell Programming and Scripting

Use sqlplus statement inside case sentence

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)
Discussion started by: Vares
3 Replies
All times are GMT -4. The time now is 02:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy