root env


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers root env
# 1  
Old 07-09-2003
root env

Dear Guys ,

i installed sun solaries 8 for intel platform .

now i want to edit root env or init. files in order to add the follwing :

EDITOR=vi
export PATH EDITOR
export PS1=`uname -n`:\$PWD\>
set -o vi
alias dir="ls -la|more"
alias c=clear
stty erase "^H"

what file i have to edit in order to add those ??

root shell is /sbin/sh
in root home dir no .profile exit !

i tried to edit .profile for normal user and it worked fine .

but still it is not working for the root user .

also i tried to edit /etc/skel/local.profile ,, but same thing

Thanks
# 2  
Old 07-09-2003
Try ls -a in the root's home directory ( probably / ) to see if the .profile file exists since it is a hidden file.

If it does not exists then you should copy /etc/skel/local.profile ( which is a template file ) to the root's home directory & rename it to .profile & make the required changes to take effect.

Hope it helps.
minazk
# 3  
Old 07-09-2003
hi ,

i did but still did not work .. also i tried it before .

i created .profile file at root home dir ( / ) with only 600 permissions .

the content of the file :
Code:
# @(#)local.profile 1.8 99/03/26 SMI
stty istrip
PATH=/usr/bin:/usr/ucb:/etc:.
export PATH
alias c=clear

#
# If possible, start the windows system
#
if [ "`tty`" = "/dev/console" ] ; then
        if [ "$TERM" = "sun" -o "$TERM" = "sun-color" -o "$TERM" = "AT386" ]
        then

                if [ ${OPENWINHOME:-""} = "" ] ; then
                        OPENWINHOME=/usr/openwin
                        export OPENWINHOME
                fi

                echo ""
                echo "Starting OpenWindows in 5 seconds (type Control-C to inter
rupt)"
                sleep 5
                echo ""
                $OPENWINHOME/bin/openwin

                clear           # get rid of annoying cursor rectangle
                exit            # logout after leaving windows system

        fi
fi

after i saved , i restart all the machine and tried to log as root and enter " c " at command line i did not do the clear !

# c
c: not found

Thanks !

added code tags for readability --oombera

Last edited by oombera; 02-20-2004 at 10:45 AM..
# 4  
Old 07-09-2003
In your home directory, look for a .cshrc file (again, using "ls -a") and add the alias command that you want in there. On my system, I have a .kshrc file that I add new aliases to and they stick between logins.
# 5  
Old 07-09-2003
hi ,
why .cshrc while my root shell is /sbin/sh .

but also i created .cshrc file like this "

# more .cshrc
# @(#)cshrc 1.11 89/11/29 SMI
umask 022
alias c=clear
set path=(/bin /usr/bin /usr/ucb /etc .)
if ( $?prompt ) then
set history=32
endif


and it did not work !!

the other options like ( EDITOR , PATH , umask ) which are on .profile are working ... only the alias is not working !!

thansk
# 6  
Old 07-09-2003
sh does not have an alias command - you would have to either change the shell that root uses by changing it in /etc/passwd (not usually recommended due to problems when booting into single user and running startup scripts while booting) or use a different shell after logging in and sourcing the .profile and .xxxrc (where xxx is your choice of shell).

Read the man page on sh, ksh, and others for more information.
# 7  
Old 07-09-2003
Semi-related.. found a little chart that lists a few differences. Wow, if this is the general pattern then sh has very limited functionality in comparison to the other shells..
Code:
FEATURE                FUNCTION                                        SH  CSH  KSH

Job control	       Processes can be run in the background          No  Yes  Yes
History substitution   Prev commands can be saved, edited and reused   No  Yes  Yes
File name completion   Auto completion of partially typed filename     No  Yes  Yes
Command line editing   Can use an editor to modify command line text   No  No   Yes
Command aliasing       User can rename commands                        No  Yes  Yes

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can you gain root privileges if the suid program does not belong to root?

I had a question in my test which asked where suppose user B has a program with 's' bit set. Can user A run this program and gain root privileges in any way? I suppose not as the suid program run with privileges of owner and this program will run with B's privileges and not root. (1 Reply)
Discussion started by: syncmaster
1 Replies

2. Shell Programming and Scripting

Find users with root UID or GID or root home

I need to list users in /etc/passwd with root's GID or UID or /root as home directory If we have these entries in /etc/passwd root:x:0:0:root:/root:/bin/bash rootgooduser1:x:100:100::/home/gooduser1:/bin/bash baduser1:x:0:300::/home/baduser1:/bin/bash... (6 Replies)
Discussion started by: anil510
6 Replies

3. Solaris

Migration of system having UFS root FS with zones root to ZFS root FS

Hi All After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Discussion started by: sb200
2 Replies

4. Web Development

Deny from env=env-variable Does not work

(Above from Apache docs). On my system, using: SetEnvIf User-Agent Mozilla IsBad=1 Order allow,deny Allow from all Deny from env=IsBad ...I see that environment variable is set (using phpinfo()) but the page is still served. No errors in the Apache logs. (1 Reply)
Discussion started by: gnurob
1 Replies

5. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

6. AIX

Can't login root account due to can't find root shell

Hi, yesterday, I changed root's shell in /etc/passwd, cause a mistake then I can not log in root account (can't find correct shell). I attempted to log in single-mode, however, it prompted for single-mode's password then I type root's password but still can not log in. I'm using AIX 5L version 5.2... (2 Replies)
Discussion started by: neikel
2 Replies

7. Solaris

Root ENV is different from users', how to change?

Hello, I'm working on a Solaris 9 machine. I found the root's environment variables (say, $PATH, $ORACLE_HOME, big problem) were set differently from the users'. All regular users use C shell now and share the same environment file stored in /usr/local/config/cshrc.default. Should I just use... (4 Replies)
Discussion started by: alanlh
4 Replies

8. Shell Programming and Scripting

Adding command line env in cron env

Hello friends, i run two scripts manually & they work. i run them in cron & they don work. how to match the two env's 1.command line env 2.cron env i would like cron to use command line env. Thanks & Regards Abhijeet (1 Reply)
Discussion started by: abhijeetkul
1 Replies

9. UNIX for Dummies Questions & Answers

Run non-root script as root with non-root environment

All, I want to run a non-root script as the root user with non-root environment variables with crontab. The non-root user would have environment variables for database access such as Oracle or Sybase. The root user does not have the Oracle or Sybase enviroment variables. I thought you could do... (2 Replies)
Discussion started by: bubba112557
2 Replies

10. UNIX for Dummies Questions & Answers

PWD env variable for root

How do you get the $PWD env variable set for root? I know it's automatic for korn and other shells, but root uses /usr/bin/sh. (5 Replies)
Discussion started by: bcole23
5 Replies
Login or Register to Ask a Question