.bash_profile file corrupted

Hi,

Unexpectedly i entered wrong entries in .bash_profile for my user which has administrative permissions. So, i am getting errors for every command. I dont have backup file also, so any body can help me how to recover it.

Regards,
Mastan

What errors are you getting? Maybe it's just the PATH that's wrong?

Next time make a backup copy before you muck with it. Unix 101.

You ought to be able to copy a working default file from /etc/skel/ into your home directory, overwriting the broken file.

A backup wouldn't help much if you don't have the ability to use the backup...

How do you login to root? If you do su instead of su - from another user, you should be able to login as root without reading root's profile, and work from there.

Why wouldn't you have the ability to use it? Use root, or another user account + sudo, or even boot the machine using a bootable live CD and mount your home filesystem and move the file. Plenty of ways to skin this cat!

We all have been in this boat. You have to manually do the most important things in your profile, like stty options and $PATH, $LD_LIBRARY_PATH, PS1. When you gat it fixed, make a copy called .bash_profile.YYYYMMDD for future reference.

Thanks guys, issue got resolved by copying default .bash_profile from another system.

Rregars,
Mastan

Try to customize it so it can run on any user, like ~ not ~myid, and then you can share it, borrow it back.