Project

General

Profile

« Previous | Next » 

Revision 9004

lib/util.sh: added bool2int ()

View differences:

lib/util.sh
69 69
let () { builtin let "$@" || true; }
70 70
	# "If the last ARG evaluates to 0, let returns 1" (`help let`)
71 71

  
72
bool2int () { save_e test -z "$1"; echo "$e"; } # empty->0; non-empty->1
73

  
72 74
#### arrays
73 75

  
74 76
join () { local IFS="$delim"; echo "$*"; } # usage: delim=... join elems...

Also available in: Unified diff