LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to Edit the .bash_profile being a normal user in Red Hat Linux? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-edit-the-bash_profile-being-a-normal-user-in-red-hat-linux-863593/)

Rahulr7 02-18-2011 02:08 PM

how to Edit the .bash_profile being a normal user in Red Hat Linux?
 
I have installed Oracle Database server in Red Hat Linux for the first time. I edited the .bash_profile first time & defined some parameters like "export ORACLE_SID =orcl".I quit the editing. Then When I entered ". .bash_profile" it got error " not a valid identifier" it shows like

"bash: export: '=orcl' : not a valid identifier

for all the lines I edited it shows same error beacause I think I put a space in between "ORACLE_SID" & "=orcl".

So when I tried to edit that using "vi .bash_profile" being a normal user. It doesn't allow me editing.when I try to delete that space (because I think I have got error) using Backspace key on my computer,,it just moves the cursor to left in stead of deleting that space.

so can you please provide me solution for editing this " .bash_profile" ?

John VV 02-18-2011 02:25 PM

it might help if you posted exactly what you added to the local normal user .bash_profile file

also that would not be the best place to make system changes

look at /etc/profile & /etc/bashrc

xeleema 02-18-2011 02:26 PM

Greetingz!

You need to go over bash's man page. Maybe google a bit.

To Define an Environment Variable in bash:
Code:

VAR_NAME=var_value
To Make an Environment Variable Persistent:
Code:

export VAR_NAME
To View an Environment Variable:
Code:

echo $VAR_NAME
Hit up my NewComer's Blog Post for a quick write-up (and some great links!).

If this post (or any other) was helpful, click "Yes" in the bottom-right-hand corner of the post.
Also, if your problem is solved, use the "Thread Tools" at the top of the page to mark this as [SOLVED].

Rahulr7 02-18-2011 03:31 PM

I did what you asked.
 
Quote:

Originally Posted by John VV (Post 4263099)
it might help if you posted exactly what you added to the local normal user .bash_profile file

also that would not be the best place to make system changes

look at /etc/profile & /etc/bashrc

I have provided the parameters I added in the .bash_profile.

please help me figure out the solution.

smoker 02-18-2011 04:11 PM

post your .bash_profile HERE .
Please use code tags.

Also, you need to learn VI.
You have to be in edit mode for the keys to work as you expect.

xeleema 02-18-2011 07:19 PM

Quote:

Originally Posted by Rahulr7 (Post 4263168)
I have provided the parameters I added in the .bash_profile.
please help me figure out the solution.

Post the contents of your .bashrc or .bash_profile file that you are attempting to edit;

1) Run the following command;
Code:

grep -v "^#" .bash_profile | grep . | nl
2) Copy-and-Paste the output like so;
Quote:

[CODE]
Output that you copy-and-pasted
[/CODE]
Thank you.


All times are GMT -5. The time now is 08:34 AM.