permission script
David N. Lombard
dnl at speakeasy.net
Sun Oct 25 18:24:23 UTC 2009
Eugeneapolinary Ju wrote:
> I just wrote a little script, that will echo a message to the user, if
> it doesn't have enough permission:
>
> $ if ! [ "$(env LC_MESSAGES=C ifconfig wlan0 down | grep -i denied)" ==
> "" ]; then echo "no permission"; fi
You can also directly use grep for that:
LC_MESSAGES=C ifconfig wlan0 down 2>&1 | grep -qi denied && echo "no perm"
--
David N. Lombard
More information about the ubuntu-users
mailing list