2014-10-26 16:18:24 +00:00
|
|
|
getvar() {
|
|
|
|
eval "echo \"\${$1}\""
|
|
|
|
}
|
|
|
|
|
2006-10-10 15:30:50 +00:00
|
|
|
var2file() {
|
|
|
|
local var
|
|
|
|
eval "var=\"\${$1}\""
|
|
|
|
if [ -n "$var" ]; then echo "$var" > "$2"; fi
|
|
|
|
}
|
|
|
|
|
|
|
|
isset() {
|
|
|
|
local var
|
|
|
|
eval "var=\"\${$1}\""
|
|
|
|
[ -n "$var" ]
|
|
|
|
}
|
2006-11-27 04:25:34 +00:00
|
|
|
|
2007-03-23 19:13:08 +00:00
|
|
|
md5s() {
|
2008-09-02 10:57:51 +00:00
|
|
|
cat "$@" | (
|
|
|
|
md5sum 2>/dev/null ||
|
2015-03-29 07:29:18 +00:00
|
|
|
md5
|
2008-09-02 10:57:51 +00:00
|
|
|
) | awk '{print $1}'
|
2007-03-23 19:13:08 +00:00
|
|
|
}
|