RE: sudo and globbing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Harry Putnam [mailto:hgp@sbcglobal.net]
> Sent: Mon, February 03, 2003 3:25 PM
> To: psyche-list@redhat.com
> Subject: sudo and globbing
> 
> 
> I didn't notice anything in man sudo to explain why globbing doesn't
> work using sudo.  At least in this instance
> 
> as root
>     ls /root/inst*
>   /root/install.log  /root/install.log.syslog
> 
> as user
> 
>     sudo ls /root/inst*
>   ls: /root/inst*: No such file or directory
Expansion is performed by the shell, before sudo is executed. When you run
ls as root, the actual command line passed to ls is 
'ls /root/install.log /root/install.log.syslog'

When you execute it as user, command line to ls will be:
'ls /root/inst*'
because your shell can not access /root directory. This makes ls to complain
since there is no such file '/root/inst*'

> 
>     sudo ls /root/install.log
>   /root/install.log
> 
> 
> 
> -- 
> Psyche-list mailing list
> Psyche-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/psyche-list
> 



-- 
Psyche-list mailing list
Psyche-list@redhat.com
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux