LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 01-14-2011, 08:47 AM   #1
Shakyj
LQ Newbie
 
Registered: Jul 2006
Posts: 7

Rep: Reputation: 0
Bad shell interpreter


I seem to have broken my shell.

I ran "sudo update-alternatives --install /bin/bash sh /bin/sh 1"(don't ask)

Now whenever I run scripts I get bash: sh: command not found

"which sh" brings up

"-su: /usr/bin/which: /bin/sh: bad interpreter: No such file or directory"

I have a shell logged in as # but I just don't know how to fix it.

Any help would be much appreciated.

Thanks
 
Old 01-14-2011, 08:55 AM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
I might try to boot from your Ubuntu Live CD, mount the hard drive, and copy the Live CD's /bin/bash into the bin directory of the hard drive.

Maybe someone else has a better idea, and I don't know what "update-alternatives" is.

Last edited by MTK358; 01-14-2011 at 08:59 AM.
 
Old 01-14-2011, 09:13 AM   #3
Shakyj
LQ Newbie
 
Registered: Jul 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by MTK358 View Post
I might try to boot from your Ubuntu Live CD, mount the hard drive, and copy the Live CD's /bin/bash into the bin directory of the hard drive.

Maybe someone else has a better idea, and I don't know what "update-alternatives" is.
It's deb lenny. If I ls /bin I can see bash and sh. But I can't see them in /usr/bin. But that gives me an idea I am going to try to scp bash and sh from the machine I am on now to the machine I broke.

That worked. Scping ubuntu's /bin/bash to the machine with the broken shell.

Thanks for the idea

Last edited by Shakyj; 01-14-2011 at 09:14 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bad interpreter Vikenoshi Linux - Newbie 2 03-21-2008 02:24 PM
bad interpreter in script c0d3 Programming 11 12-15-2004 04:48 AM
bad interpreter???? yenonn Programming 4 09-25-2004 05:21 AM
/bin/sh: bad interpreter mullog Linux From Scratch 1 06-09-2004 02:30 PM
bad interpreter penzilsinc Linux - Newbie 5 06-26-2002 01:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration