Bash: [[…]]: the pattern, quoting, …

https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html — look for the very helpful xxx.txt example! I was tempted to put the entire pattern in (double) quotes. But that’s not Bash style. You can “certainly” put literal parts in quotes, but regexp parts do not belong in quotes — quotes are good for protecting, amongst other aspects: protecting against interpretation as regular expression. That’s… Continue reading Bash: [[…]]: the pattern, quoting, …

ksh88 man page

www2.research.att.com/sw/download/man/man1/ksh88.html – the man page NAME SYNOPSIS DESCRIPTION Definitions Commands Comments Aliasing Tilde Substitution Command Substitution Process Substitution Parameter Substitution Blank Interpretation File Name Generation; bash: shopt extglob on # “extended globbing” Quoting Arithmetic Evaluation Prompting Conditional Expressions Input/Output Environment Functions Jobs Signals Execution Command Re-entry In-line Editing Options Emacs Editing Mode Vi Editing Mode Input… Continue reading ksh88 man page

O’Reilly Media book: Classic Shell Scripting

http://shop.oreilly.com/product/9780596005955.do https://resources.oreilly.com/examples/9780596005955/ (a Git repository) http://examples.oreilly.com/9780596005955/ nice scripts shown there and available in the sample code: pathfind.sh – rather similar to my own find_file_on_PATH.sh show-identical-files.sh – rather similar to my own group_by_content.sh – but has a problem with “md5sum” – I fixed that puser.sh …  

shell programming: “for” loops vs. “while” loops and scope of variables created within loop bodies

Variables, that you create (by assignment) within loop bodies, are well visible outside the loop body. This is valid for both kinds of loop. CAVEAT: If the “while” loop reads from a pipe, the “while” loop is executed within a subshell, i.e. the scope of the variables within the loop ends with the loop. Example:… Continue reading shell programming: “for” loops vs. “while” loops and scope of variables created within loop bodies

GNU Coreutils “seq”

the manual page. Why do I keep forgetting the name of this wonderful little helper? seq prints a sequence of numbers to standard output. Synopses: seq [option]… last seq [option]… first last seq [option]… first increment last seq prints the numbers from first to last by increment. By default, each number is printed on a separate line. When increment is not specified, it defaults… Continue reading GNU Coreutils “seq”