This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
changeColor () { | |
## Usage | |
local help_message="\ | |
Usage: | |
changeColor ((fg|bg|light|light-bg)? color (bold|dim|underlined|inverted)*)+ | |
Example: | |
changeColor fg red light-bg green underlined bold" | |
#/> | |
## local properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# generates a string in the form of an array-declaration and puts it into declare -A | |
declare -A exit_status=$(echo -n "( \ | |
[output]=\"" ; cat /no/such/file 2>&1 ; echo -en "\" | |
[errno]=$? | |
)") | |
# to test it: | |
echo error ${exit_status[errno]}: ${exit_status[output]} >/dev/stderr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function list-package-sizes () { | |
if [ $1 ]; then | |
case $1 in | |
-h|--help) | |
local errno=0 | |
;; | |
*) | |
local errno=1 |
NewerOlder