Project

General

Profile

« Previous | Next » 

Revision 13176

lib/sh/util.sh: added has_perms()

View differences:

trunk/lib/sh/util.sh
1159 1159
function mv_glob() { echo_func; if (($# > 1)); then mv2dir "$@"; fi; }
1160 1160
alias mv_glob='shopt -s nullglob; "mv_glob"'
1161 1161

  
1162
### permissions
1162 1163

  
1164
has_perms() # usage: perms=... has_perms item # perms: use find's -perm format
1165
{
1166
	echo_func; kw_params perms; : "${perms:?}"
1167
	test "$(find "$1" -maxdepth 0 -perm "$perms")"
1168
}
1169

  
1170

  
1163 1171
#### URLs
1164 1172

  
1165 1173
localize_url() { test _"$1" = _"$(hostname -f)" || echo "$1"; }

Also available in: Unified diff