LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   my bash file is deleted , trying to restore from kernel arguments (https://www.linuxquestions.org/questions/linux-newbie-8/my-bash-file-is-deleted-trying-to-restore-from-kernel-arguments-757601/)

miteshpant 09-24-2009 05:40 PM

my bash file is deleted , trying to restore from kernel arguments
 
hi,
i have deleted my bash file
and thus the system is not letting me to bash shell
now i have a kernel panic situation
i want to log in using ksh shell passing arguments from kernel
lets begin..

chrism01 09-24-2009 05:43 PM

Please tell us which distro & version you have, and give more details.
Which 'bash' file?

1. /bin/bash - the actual shell itself
2. .bashrc
3. .bash_profile
4. other

miteshpant 09-24-2009 05:52 PM

yeah you got it right
its the /bin/bash file
i am using RHEL5

chrism01 09-24-2009 05:55 PM

I'd use the installation DVD in rescue mode ie at the first text prompt type

linux rescue


then it will run from the DVD & mount your HDD as another disk. You can fix your login to use /bin/ksh or whatever so you can at least get in.
You should then be able to use yum to re-install bash.

custangro 09-24-2009 06:02 PM

Quote:

Originally Posted by miteshpant (Post 3696120)
yeah you got it right
its the /bin/bash file
i am using RHEL5

boot into "linux rescue" mode from the installation disc

Then you can do 1 of 2 things...

Reinstall bash

Copy bash from the rescue mode

-C

miteshpant 09-25-2009 03:44 AM

the point is i don't want to use the dvd , or linux rescue mode... i want to fx it by passing arguments from the kernel to get into the computer using ksh shell

lutusp 09-25-2009 03:52 AM

Quote:

Originally Posted by miteshpant (Post 3696547)
the point is i don't want to use the dvd , or linux rescue mode... i want to fx it by passing arguments from the kernel to get into the computer using ksh shell

So this is homework. If I were in your shoes I would use the simplest, most reliable way to recover from such a disaster (e.g. copy bash from a rescue disk to the affected installation). But you don't want to do that. Ergo, homework.

Be truthful.

custangro 09-25-2009 10:47 AM

Quote:

Originally Posted by miteshpant (Post 3696547)
the point is i don't want to use the dvd , or linux rescue mode... i want to fx it by passing arguments from the kernel to get into the computer using ksh shell

Do you mean passing options to the kernel using grub?

-C

miteshpant 09-25-2009 11:28 AM

correct
i think something like
init=/bin/ksh should work

custangro 09-25-2009 12:19 PM

Quote:

Originally Posted by miteshpant (Post 3696918)
correct
i think something like
init=/bin/ksh should work

It might...try it out and let us know if it worked.

-C


All times are GMT -5. The time now is 01:29 PM.