There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
terminal change ?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
MintabiePete's Avatar
Senior Member with 113 posts.
 
Join Date: May 2002
Location: In the Outback of Australia
29-Jul-2003, 07:19 AM #1
terminal change ?
I installed a couple of programs today Adobe Acrobat and Opera browser and got halfway thru installing a Quake game until I gave up on it but while all that was going on something changed when I log into a terminal .

bash-2.05b$ su
Password:
[root@localhost pedro]#


everything seems to be working OK, and when I give an ENV command

"SHELL=/bin/bash"

is there an easy way that a novice can change the /etc/bashrc file to get my Path back to the way it was ?

bash-2.05b$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
bash-2.05b$




Thanks in advance
__________________
All the best, and have a nice day.

Mintabie Pete
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
30-Jul-2003, 02:34 AM #2
Are you certain that you are using su and not su - ? Normally, the su command will allow you to become another user, but retain your own environment settings. Adding a '-' to the command allows you to become another user, but also executes all of the login processing for that user (including possible changes to your PATH and any other environment variable, modifying aliases, etc.). If you are using su -, you can retain your environment info by using su instead.

If you are using su, and your environment is still getting reset, you can restore your original environment by executing your bashrc script after you have become root. You execute the script either by invoking it directly or by "sourcing" it (using the dot operator). For example, if your nomal login ID is pete, and your home directory is /home/pete, you could restore your environment by typing either:

~pete/.bashrc
or
. ~pete/.bashrc

Note that this will reset the entire environment, not just the PATH. If you'd like just to reset your PATH, you can get a little tricky and use something like this (after becoming root):

eval `egrep ^PATH= ~pete/.bashrc`

Note the backquotes!

Hope this helps.
__________________
The slowest component still sits at the keyboard.
MintabiePete's Avatar
Senior Member with 113 posts.
 
Join Date: May 2002
Location: In the Outback of Australia
30-Jul-2003, 07:01 AM #3
Thanks codejockey for answering me , I doubt whether I would have used su- as I tried it and it doesnt work on my terminals at all :

bash-2.05b$ su-
bash: su-: command not found
bash-2.05b$

And when I go into /home/pedro everything looks OK but when I do a ls -all I get a couple of strange entries I never noticed before :

-rw-r--r-- 1 pedro pedro 66 Jul 30 19:44 .DCOPserver_localhost.lo
caldomain_:0 -> /home/pedro/.DCOPserver_localhost.localdomain__0

Whether it is any connection re the Quake 3 demo that I tried to install I dont know , except at the time I had a icon in the taskbar looking like a little blue balloon thingie which I deleted .

I tried the other commands you suggested but couldnt seem to get any sense out of them with RHL 8.0 .

bash-2.05b$ su
Password:
[root@localhost pedro]# eval egrep ^PATH= ~pedro/.bashrc
grep: /home/pedro/.bashrc: No such file or directory
__________________
All the best, and have a nice day.

Mintabie Pete
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
30-Jul-2003, 11:45 PM #4
OK, two things going on (at least):

(1) You need to have a space between "su" and "-"; the "-" is actually an option to the su command (or more accurately, a specific form of invocation). Without the space, Linux looks for a command named su- and (as you found out) will not find any. However, that's pretty much academic anyway, if you are sure you didn't type the minus character after su.

(2) Apparently you do not have a .bashrc file in your home directory (~pedro). This may be because your login shell is not bash or because you choose not to customize anything beyond the defaults provided by system-wide configuration files. The key point, however, is that your PATH is being set somewhere. You will need to find the file(s) that are setting your PATH and possibly use one of those to reset it after things have changed.

To find these files, you might try: egrep ^PATH= ~pedro/.* and see what comes up. You may be using .profile, .kshrc, .cshrc or any number of other initialization files, so a PATH statement may appear in more than one file.

Hope this helps.
__________________
The slowest component still sits at the keyboard.
MintabiePete's Avatar
Senior Member with 113 posts.
 
Join Date: May 2002
Location: In the Outback of Australia
31-Jul-2003, 05:43 AM #5
Thanks for your time codejockey , guess you were on the right track when you mentioned me not having .bashrc file file in my home directory I couldnt find it any where but there were copies of it in root , I found it hard to work out which was the correct one so was going to try and get a copy out of rpm -qf /etc/profile on my install disks .

I have since run the RHL 8.0 disks and seem to have got the terminal back to [pedro@localhost pedro] $ at normal user and now I have backed up a lot of these files that could probably cause me problems if this happens again .

I have heard you mention about the importance of the proper spelling and where the dots go and guess I will have to make sure I am more careful next time , although I stil dont have a clue as to what I had done wrong , but suspect it was that game demo that I tried to download lol

I am trying to write down a lot of these commands and will eventually geta better knowledge of them I guess as time goes by
__________________
All the best, and have a nice day.

Mintabie Pete
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:55 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.