Re: Shell confusion

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

 



Garry T. Williams wrote:
On Thursday 12 March 2009 21:25:27 Dave Bolt IT Solutions wrote:
When I start a terminal as dave I get a prompt [dave@Test-Host ~]$
When I do su amandabackup I get a prompt bash-3.2$
            ^^^^^^^^^^^^^^^

Check the manual page for su(1).

If you had entered `su - amandabackup', that user's login scripts would have been run.

In general, using su without its `-' parameter is a bad idea[*] especially when switching to the root login.

Interesting thought, I generally warn people that "-" or "-l" will do a login, and they will wind up running in the other user's home directory. Definitely not what people want many times, such as running "make install" after building a package, or the like.

For instance
  sudo su root -c "make install"
runs the install rules in the current directory, probably just what you wanted.
  sudo su - -c "make install"
runs the install part of whatever Makefile is in root's home directory. Almost certainly not what you intended!

______________
[*] Unless, of course, you know why you want to do that.



--
Bill Davidsen <davidsen@xxxxxxx>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux