Executing perl script in Linux gives :Exec format error. Wrong Architecture


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Executing perl script in Linux gives :Exec format error. Wrong Architecture
# 1  
Old 07-21-2014
Executing perl script in Linux gives :Exec format error. Wrong Architecture

i have perl script that used to be working great , once i edit it in windows
and convert it to UTF-8 and then via FTP return it .
also did:

Code:
    chmod +x foo.pl

and then when i try to run it :
Code:
     ./foo.pl
    im getting this error:
    ./foo.pl: Exec format error. Wrong Architecture.

what ? what wrong Architecture ? whats going on here ?
# 2  
Old 07-21-2014
My guess is Windows added a BOM to the file, while converting to UTF-8. It tends to do that... (Perhaps in addition the file was ftp-transferred in binary mode instead of ASCII mode ?)
# 3  
Old 07-21-2014
You are right !
after converting it to ansi every thing worked ,
can you please tell me why its see it at wrong file if its UTF8?
by the way in notpad++ i didnt convert it to UTF8 with BOM
just plain UTF8
# 4  
Old 07-21-2014
Binary vs ASCII

Quote:
Originally Posted by Scrutinizer
My guess is Windows added a BOM to the file, while converting to UTF-8. It tends to do that... (Perhaps in addition the file was ftp-transferred in binary mode instead of ASCII mode ?)
nine times out of ten this is the problem.

I have seen numerous files not work properly because they were ftp over in binary instead of ASCII and vise versa.
# 5  
Old 07-21-2014
Quote:
Originally Posted by busi386
nine times out of ten this is the problem.

I have seen numerous files not work properly because they were ftp over in binary instead of ASCII and vise versa.
I can understand the latter, but not the former. The former should leave them unchanged no matter what.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script Output coming in wrong format....

Hi team, getting output logs wrong in different format from telnet script ... getting Output.txt macro_outdoor_dist-6.0.0(v4_0_2) DN:1.3.903 (1101:100:11w:500:3:2:103:aa) macro_outdoor_dist-8.1.0(v3_1_0) DN:1.3.409 (N/A)... (3 Replies)
Discussion started by: Ganesh Mankar
3 Replies

2. Shell Programming and Scripting

what's wrong with my -exec in find

find ./ -name *Kconfig -exec cat {} \; but it won't work with find ./ -name *Kconfig -exec cat {} |grep CONFIG_MTD |grep depend \; how could I handle this (14 Replies)
Discussion started by: yanglei_fage
14 Replies

3. Shell Programming and Scripting

What is wrong with my perl script?

i managed to write a perl script for nagios. now, the script works. but i think there's somethign wrong with the exit codes. because the script doesn't show the output of the results in nagios, it instead shows null. please tell me what i'm doing wrong here: #!/usr/local/bin/perl use... (2 Replies)
Discussion started by: SkySmart
2 Replies

4. Shell Programming and Scripting

Error in executing Perl script

Hello All I am facing an issue The unix script is running fine in unix environment which uses ssh connection but when I try to run the same in informatica environment (same server where I was running the unix script manually successfully) its showing the below error command-line line 0:... (11 Replies)
Discussion started by: Pratik4891
11 Replies

5. Shell Programming and Scripting

wrong output in perl script

Hi, Here is my piece of code-- #!/usr/bin/perl my $Time_Stamp ; my $User_Name; my $Success; my $Failure; my $ErrorCode; my $ErrorMsg; my $logDir = $ARGV; my $logPrefix = $ARGV; die "usage: $0 <logDir> <logPrefix>" unless $logDir and $logPrefix; die "Log dir $logDir doesn't... (2 Replies)
Discussion started by: namishtiwari
2 Replies

6. Linux

Error executing shell script in Linux

Hi, I have following shell script code : ------------------------------------------------------------------ #!/bin/bash SCRIPTS_DIR="/scriptsDir1" # tables login/password APIL_USER="uname/pswd" I2_USER="uname/pswd" # Database DB="db1" cd "$SCRIPTS_DIR/scriptsDir2" sqlplus... (1 Reply)
Discussion started by: Chaitrali
1 Replies

7. Shell Programming and Scripting

Error executing shell script in Linux

Hi, I have following shell script code : ------------------------------------------------------------------ #!/bin/bash SCRIPTS_DIR="/scriptsDir1" # tables login/password APIL_USER="uname/pswd" I2_USER="uname/pswd" # Database DB="db1" cd "$SCRIPTS_DIR/scriptsDir2" sqlplus... (2 Replies)
Discussion started by: Chaitrali
2 Replies

8. Shell Programming and Scripting

Error executing shell command from a perl script

Hi Gurus, I've a find command that gets the list of files from a source directory where the extension is not html, xml, jsp, shtml or htaccess. The below find command runs fine from the command prompt or in a shell script. I need to eventually run it in a PERL script and am getting the... (5 Replies)
Discussion started by: voorkey
5 Replies

9. Shell Programming and Scripting

Perl Script issue. What am I doing wrong?

#!/usr/local/bin/perl open (MYFILE, 'logs_report'); while (<MYFILE>) { $rec=$_; chomp ($rec); @arr=split(/ /,$rec); print $rec,"\n" if ($arr!~/OK/); open (MYF, '>data.txt'); print $rec,"\n" if ($arr!~/OK/); close (MYF); (14 Replies)
Discussion started by: SkySmart
14 Replies

10. Shell Programming and Scripting

perl regexp error , I cant understand what is wrong

perl regexp error , I cant understand what is wrong Hello all I have simple perl regexp that is searching for pattern in string and replace it with the same string + addition string here is what I have : my $rec = q| new Array("Attributes Management" ... (4 Replies)
Discussion started by: umen
4 Replies
Login or Register to Ask a Question