Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Accessing microphone
- Date: Mon, 8 May 2006 20:37:05 +0900
- From: "Josh Glover" <jmglov@example.com>
- Subject: Re: [tlug] Accessing microphone
- References: <445C45C7.8030906@example.com> <445ED4E6.4010803@example.com> <d8fcc0800605072242y3510bb6ep1ac224a5ea70c210@example.com> <445EE6D9.1020508@example.com> <d8fcc0800605080003g492b9674v7ee1e93dee9772f9@example.com> <445EF3D6.9000507@example.com> <d8fcc0800605080038q636dd6cen59e7a4dd12c73e38@example.com> <445F0489.3010400@example.com> <20060508111314.365bede2.godwin.stewart@example.com> <445F23F2.30408@example.com>
On 08/05/06, Dave M G <martin@example.com> wrote:dave@example.com:~$ sudo generate-modprobe.conf > /etc/modprobe.conf bash: /etc/modprobe.conf: Permission denied How can I be denied permission if I'm doing it with "sudo"? It didn't even ask me for my password?This is a great example to illustrate how a shell works. When you type the above command, the shell interprets it as: 1. Run the "sudo generate-modprobe.conf" command, then 2. Redirect its output to the "/etc/modprobe.conf" file sudo ensures that the "generate-modprobe.conf" file runs as root, but the shell, which is redirecting the output of the command to a file, is still running as a non-privileged user, namely, you. There are (at least) two ways around this. One would be to redirect the output of the command to a file to which you have write permission, then move it to its proper location, i.e. generate-modprobe.conf > /tmp/modprobe.conf sudo mv /tmp/modprobe.conf /etc/modprobe.conf Or, you could use the magic of tee(1) and Unix pipes: generate-modprobe.conf | sudo tee /etc/modprobe.conf Read the manpage of tee(1) to see why this works. :) -Josh
- Follow-Ups:
- Re: [tlug] Accessing microphone
- From: Dave M G
- References:
- [tlug] Accessing microphone
- From: Dave M G
- Re: [tlug] Accessing microphone
- From: Dave M G
- Re: [tlug] Accessing microphone
- From: Josh Glover
- Re: [tlug] Accessing microphone
- From: Dave M G
- Re: [tlug] Accessing microphone
- From: Josh Glover
- Re: [tlug] Accessing microphone
- From: Dave M G
- Re: [tlug] Accessing microphone
- From: Josh Glover
- Re: [tlug] Accessing microphone
- From: Dave M G
- Re: [tlug] Accessing microphone
- From: Godwin Stewart
- Re: [tlug] Accessing microphone
- From: Dave M G
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Accessing microphone
- Next by Date: Re: [tlug] Accessing microphone
- Previous by thread: Re: [tlug] Accessing microphone
- Next by thread: Re: [tlug] Accessing microphone
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links