Mailing List Archive


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

Re: [tlug] Accessing microphone



>>>>> "Dave" == Dave M Gwrites:

    Dave> Godwin,

> That's because it's not in a regular user's $PATH, only in root's path.
> As I said earlier, you have to ***BE*** root, not just have root's
> permissions.

    Dave> dave@example.com:~$ sudo -s
    Dave> root@example.com:~# generate-modprobe.conf > /etc/modprobe.conf
    Dave> bash: generate-modprobe.conf: command not found
    Dave> root@example.com:~# exit
    Dave> exit

I think Godwin's in a bad mood....

A (command) shell is just a program which aids users in running
programs, either in a sequence (a script) or interactively.  Many
shells distinguish three different kinds of invocation:

batch - running a script, may run a setup script first (often not)
interactive - normal mode, normally runs a different setup script
login - the shell run by the login program when you first sign on to
    the system, runs a third setup script.

In the case of bash, ISTR that the batch mode doesn't run any setup
script, interactive mode runs the .bashrc script, and login mode runs
the .profile script.

Normally the login shell sets up things like PATH.  It is usually the
case that the rc script does not set PATH and things like that; those
are inherited from the parent environment.  (This is the default
RightThang[tm] for complex reasons I won't go into.  Of course I admit
that this is inconvenient for you today, but in many admins' usage
there are good reasons to do it this way.)

Now, the man page is not very clear, but it looks like "sudo -s" just
runs an interactive shell.  This should give you the power of root,
but not root's environment.  That's why bash can't find the program.
"su -" runs a login shell, which gives you both.  That's why Godwin
expects that to do what you want.

You could also do

$ PATH=$PATH:/sbin:/usr/sbin sudo -s

which should do what you need in this case.



-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links