alias strace='dtruss'
alias updatedb='sudo sh -c "cd / && exec /usr/libexec/locate.updatedb"'
-if ! which seq 1>/dev/null; then
seq() {
+ which seq && (eval "$(which seq) $@"; return)
if [ -n "$2" ]; then
jot - "$1" "$2"
else
rm /tmp/myports.txt
}
-not_darwin() {
+is_darwin() {
case "$OSTYPE"
in darwin*) return 0 ;;
*) return 1 ;;
}
getent() {
- not_darwin && (eval "$(which getent) $@"; return)
- local db=$1; shift
- [ "$db" != 'passwd' ] && echo "Support only passwd untill now" && return 1
+ which getent && (eval "$(which getent) $@"; return)
+ [ "$1" != 'passwd' ] && echo "Support only passwd untill now" && return 1
[ -z "$2" ] && (ls_users; return)
ls_users | grep "^$2:"
}