LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 04-19-2010, 01:23 PM   #1
Dimitriy
Member
 
Registered: Oct 2005
Distribution: Ubuntu Dapper (6.06)
Posts: 92

Rep: Reputation: 15
Exec format error. Binary file not executable. Fetch Bug?


Code:
freenas:~# cd /root
freenas:~# fetch -o /root/sab.sh "https://sourceforge.net/apps/phpbb/freenas/download/file.php?id=1188"
/root/sab.sh                                  100% of 2120  B  480 kBps
freenas:~# chmod 0555 sab.sh
freenas:~# ./sab.sh
./sab.sh: Exec format error. Binary file not executable.
Clean install FreeNAS 0.7.1. I am using notepad++ on a windows 7 box to create this script and doing the Edit->EOL Conversions->Convert to Unix format. Then upload it the forums and download it from the web to my freenas box using fetch to download it.

If I transfer the same file over using WinSCP locally then i can chmod it and execute it.

When I fetch it seems to add some bogus data to the beginning of the file.

Been trying to figure this out for hours. Any ideas? Its like its downloading it in the wrong mode... I even tried zipping it, uploading it, downloading it, and still not success.

Any ideas? Alternative to fetch?
~d
 
Old 04-21-2010, 04:30 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
After retrieving the file with fetch, what does the following tell you?
Code:
% file sab.sh
 
Old 04-21-2010, 04:34 PM   #3
Dimitriy
Member
 
Registered: Oct 2005
Distribution: Ubuntu Dapper (6.06)
Posts: 92

Original Poster
Rep: Reputation: 15
Issue has been resolved.
http://sourceforge.net/apps/phpbb/fr...&t=6513#p31580

Needed to save the file in Unix format and ANSI (it was originally in Unix and UTF-8 with/out BOM).

http://en.wikipedia.org/wiki/Byte_order_mark
Has a table of the what you would see in the beginning of the file if you have it saved in UTF-8 etc.

thank you,
dpc
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How would I convert an arbitrary binary file into a Linux executable file? ootawata Programming 8 02-21-2010 11:21 PM
Library issues while installing from a binary executable file kliew Red Hat 4 03-18-2009 07:34 PM
not in executable format: File format not recognized ypy13 Linux - Newbie 9 07-09-2008 11:33 PM
Exec format error. binary file not executable. kaz2100 Linux - General 2 08-19-2006 05:26 PM
MDK 9.1 Fatal Error in Stage 1: Exec Format Error Beano Mandriva 5 09-12-2004 03:04 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 05:09 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