LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-30-2009, 10:08 PM   #1
Registered: Aug 2003
Posts: 51

Rep: Reputation: 15
Strange script error - any ideas (bash hanging)

This is on all of my Ubuntu 8.10 machines - but I think it is the version of bash (3.2.39) rather than Ubuntu.
Try the following...

Create a file containing a command, for example ls
echo ls > foo

Make it executable
chmod +x foo

Run it - it will work (as it should).

Now ssh to your local machine using, (assumes you have openssh-server installed on your local machine).
ssh localhost

Now run the script again. It will hang, taking 100% cpu. Kill it with control-\ (or kill from another console).

You can fix it by putting #!/bin/bash on the first line, but it shouldn't be necessary.


Old 01-30-2009, 10:29 PM   #2
Senior Member
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,064

Rep: Reputation: 184Reputation: 184
It worked fine for me - bash version 3.1.17(2)



bash, hang

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange if statement behaviour when using bash/bash script freeindy Programming 7 08-04-2008 06:00 AM
Bash script shows strange behaviour when started at boot time michael_kaeppler Linux - General 2 05-11-2008 08:37 PM
killing child processes of a bash script results in strange random kills omnio Programming 6 03-12-2007 07:35 AM
A strange bash script kingsyl Linux - Newbie 2 07-13-2004 11:07 PM
strange bash login error figmentium Linux - Newbie 3 08-11-2003 04:27 PM

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

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