Bash: [[…]]: the pattern, quoting, … — 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 – 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 (a Git repository) nice scripts shown there and available in the sample code: – rather similar to my own – rather similar to my own – but has a problem with “md5sum” – I fixed that …  

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”