Category: The Shell Programming Language
-
“ShellCheck finds bugs in your shell scripts” – shell script analysis tool
https://www.ShellCheck.net/ https://github.com/koalaman/shellcheck “You can cabal, apt, dnf, pkg or brew install it locally right now” “already packaged for your distro or package manager” “written in Haskell, if you’re into that sort of thing”
-
the “bash” utility has an switch to deal with shell patterns that do not resolve – what’s its name?
https://en.wikipedia.org/wiki/Bash_(Unix_shell) $ shopt -s nullglob I am making use of that feature in this script: https://github.com/JochenHayek/misc/blob/master/renaming_scanner_files/WhatsApp.rename.sh
-
Unix 7th Edition Manuals in PDF – where to get them
http://plan9.bell-labs.com/7thEdMan/bswv7.html these documents contain the manual pages (in original layout) describing the Bourne Shell, awk etc
-
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…
-
O’Reilly Media book: Learning the bash Shell, 3rd Edition
Learning the bash Shell, 3rd Edition – O’Reilly Media
-
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…
-
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:…
-
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…