LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 05-28-2012, 12:51 PM   #1
dkd
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
BeagleBoard-xM sh and bash : command not found


Hello, I have a beagleboard-xM here running the angstrom distribution.

I try to run the program ls from a bash script with the command sh auto.sh
This is the content of the file:

Code:
#!/bin/sh
ls
I get the error
: not foundne 2: ls

So it looks like the command ls cannot be found.
When I type echo $PATH I get /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

The ls program can be found in /bin. I checked that with whereis ls. I am logged in as root user on the board and try to run the bash script from /home/root. I marked the bash script '777' with chmod.

The sh program is also in the folder /bin and is owned by the user www-data and group www-data. The
file is marked as '777' and is a symlink to busybox. I logged in to the www-data account with su www-data and typed echo $PATH
/bin:/usr/bin is the ouput.

I also tried it with the full path /bin/ls in the bash script but without result.

There is also normal bash in the /bin folder and is owned by the user root. I changed the first line
of the bash script to #!/bin/bash and tried to ran the bash script with bash auto.sh but I get the same error.

another thing I tried is the command ldd to see if there is a shared library missing.
The output of the command ldd bash:

libtinfo.so.5 => /usr/lib/libtinfo.so.5 (0x40026000)
libdl.so.2 => /lib/libdl.so.2 (0x4004c000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40057000)
libc.so.6 => /lib/libc.so.6 (0x40069000)
/lib/ld-linux.so.3 (0x40000000)

The output of the command ldd sh:

libm.so.6 => /lib/libm.so.6 (0x40026000)
libc.so.6 => /lib/libc.so.6 (0x40099000)
/lib/ld-linux.so.3 (0x40000000)

Does this mean these libries are present?

I searched a lot of forums, including this one.
But without any result.Does anyone knows a solution for this problem?

Thanks in advance

Dennis
 
Old 05-29-2012, 11:21 PM   #2
Kenhelm
Member
 
Registered: Mar 2008
Location: N. W. England
Distribution: Mandriva
Posts: 360

Rep: Reputation: 170Reputation: 170
If the script has been edited in Windows it could contain carriage return characters at the end of each line.
http://en.wikipedia.org/wiki/Newline
A carriage return takes printing back to the beginning of the line so that whatever has been printed starts to get overprinted. This would explain the badly formed error message.
Code:
echo -e '
auto.sh: line 2: ls\r: not found'

: not foundne 2: ls
 
  


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
bash: ls-l:command not found umeshgupta1987 Linux - Newbie 1 10-03-2010 06:46 AM
[SOLVED] bash: command not found rohit0825 Linux - Newbie 4 01-24-2010 05:31 PM
bash -command not found- ALInux Linux - Newbie 3 12-30-2006 12:41 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
bash: ll: command not found x2000koh Linux - Newbie 3 08-08-2003 05:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

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

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