permission script

Eugeneapolinary Ju eugeneapolinary81 at yahoo.com
Sun Oct 25 17:19:37 UTC 2009


omg... :D thank you!! it works!! :D

--- On Sun, 10/25/09, ~TraydenT~ <traydent at gmail.com> wrote:

From: ~TraydenT~ <traydent at gmail.com>
Subject: Re: permission script
To: ubuntu-users at lists.ubuntu.com
Date: Sunday, October 25, 2009, 4:47 PM

Le 25/10/2009 17:42, Eugeneapolinary Ju a écrit :
> 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
> SIOCSIFFLAGS: Permission denied
> $ sudo su
> [sudo] password for USER:
> # if ! [ "$(env LC_MESSAGES=C ifconfig wlan0 down | grep -i denied)" 
> == "" ]; then echo "no permission"; fi
> #
>
> but it won't works
>
> why?
>
>
The ifconfig command returns the denied message on the standard error, 
not on stdout. To find if it was denied, you way redirect stderr on 
stdout (by adding 2>&1 to the command line ), or check the return code 
of the ifconfig command.

-- 
ubuntu-users mailing list
ubuntu-users at lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20091025/93cb4852/attachment.html>


More information about the ubuntu-users mailing list