- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Setup prompt from script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 02:21 AM
09-27-2006 02:21 AM
When I "su" to root (I can't change the root .profile) I want to run the following to set things up the way I like....but it is not running. Any ideas?
#!/usr/bin/ksh
PS1="`whoami`@`uname -n`:\$PWD# ";export PS1
alias l="ls -la"
Solved! Go to Solution.
- Tags:
- PS1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 02:24 AM
09-27-2006 02:24 AM
Re: Setup prompt from script
Are you typing:
$ su root
or
$ su - root
?
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 02:25 AM
09-27-2006 02:25 AM
Re: Setup prompt from script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 02:27 AM
09-27-2006 02:27 AM
Solutionput your commands in a file 'my_settings' and then execute
. /path/to/my_settings
(there is a space between the dot and the pathname!).
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 02:29 AM
09-27-2006 02:29 AM
Re: Setup prompt from script
You have al that you need. Encapsulate your commands in a file as you show and when you have 'su'-ed to root, source (read) the file:
$ su root
# . ./mythings
Note the dot followed by a space, followed by your file's name.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 02:29 AM
09-27-2006 02:29 AM
Re: Setup prompt from script
Other than that, are you sure you're modifying root's .profile? vi '~/.profile' if you're logged in as root. Usually you will see lines like " echo "WARNING: YOU ARE SUPERUSER !!\n"" -- do you see that warning when you log in as root?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 02:35 AM
09-27-2006 02:35 AM
Re: Setup prompt from script
Note that you should never change root's shell from /sbin/sh.
Why can't you change ~root/.profile? As others have said, you should be able to place your customized settings in a separate file, and then source it by adding '.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2006 02:49 AM
09-27-2006 02:49 AM
Re: Setup prompt from script
I have it already in a script but didn't realize I had to put the "." then a space to run it.
Thanks!