KSH shell script zip command not working correctly: eval: zip: cannot execute [Exec format error]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












First off, our development environment just got upgraded to RHEL 7.5 (Maipo), we were previously on Oracle Solaris 10. Once we switched from Solaris to Red Hat this problem began. The Korn shell script below works correctly in production which is still on Solaris 10. So I am assuming that has something to do with the issue. The zip files that are being zipped up and downloaded are not saving to the zip folder. When I open the zip folder on the desktop that I just downloaded the zip folder is empty.



The pic below shows the file list. The user will select a checkbox for the files they want to download and then they click the zip and download link and it should zip up those selected files and save it to your desktop. Unfortunately the zip folder is empty. Any ideas what the problem may be? Any help will be appreciated, Thanks.



enter image description here



Here is the shell script that is being called below:



 1 #!/bin/ksh
2 #
3 # Utility to zip up files in the configuration_aerodynamic_properties area.
4 # Script takes two arguments the directory and the file list.
5 # The file list is tab seperated.
6 # This script returns the zip file.
7 #
8 # $Log: vmdb_zip_files.sh,v $
9 # Revision 1.4 2014/10/21 19:53:31 wmorris1
10 # ASR 13563 - Change incorrect mime type text/text to text/plain.
11 #
12 # Revision 1.3 2012/04/30 18:46:03 wmorris1
13 # ASR 12774 - Fix SSL and IE issue found after going to SSL.
14 #
15 # Revision 1.2 2004/11/11 12:49:33 bmorris
16 # ASR 55414 - removed UNIX groups for zipped file.
17 #
18 # Revision 1.1 2004/10/18 20:10:32 bmorris
19 # Initial revision
20 #
21 #set -x
22 #set -v
23 function error_message
24 echo "Content-Type: text/plain;"
25 echo "Content-Disposition: attachment; filename="download_error.txt";"
26 COMMAND="unix2dos "
27 echo ""
28 echo "$($COMMAND <<-EOF
29 Error: $1
30
31 EOF
32 )"
33
34 if [ "$#" -lt 2 ]; then
35 error_message "Insufficient arguments to $(basename $0)!"
36 return 1
37 fi
38 CONTENT="application/x-zip-compressed"
39 # Parse the directory path.
40 # Internal Field Sep (IFS) empty, cause spaces in file names, directories are important
41 IFS=$""
42 FULL_DIRECTORY_PATH=$(echo "$1" | tr -d '~\')
43 # File lists are seperated by tabs, parse them
52 IFS=$(printf 't')
53 set -A FILE_LIST $2
54 # Make each of the file parameters in the file list protected.
55 let count=0
56 while (( $count < $#FILE_LIST[*] )); do
57 FILE_LIST[count]=""$FILE_LIST[count]""
58 let count="count +1"
59 done
60 # Reset the IFS to the default.
61 IFS=$(echo " nt")
62 if [[ -n $3 ]]; then
63 WEB_FILENAME="$3"
64 fi
65 # Don't let the user download stuff.
66 if [[ "$1" = *..* ]] || [[ "$1" = *~* ]] || [[ "$2" = *..* ]] || [[ "$2" = *~* ]]; then
67 error_message "Path $1/$2 violates security."
68 return 1
69 elif [[ ! -f $FULL_DIRECTORY_PATH ]] && [[ ! -d $FULL_DIRECTORY_PATH ]]; then
70 error_message "$FULL_FILE_PATH does not exist or is not regular."
71 return 1
72 elif [[ ! -r $FULL_DIRECTORY_PATH ]]; then
73 error_message "$FULL_FILE_PATH is not readable from the web."
74 return 1
75 fi
76 # Zip up the f
79 COMMAND="cd "$FULL_DIRECTORY_PATH"; zip -rX - $FILE_LIST[*]"
82 echo "Content-Type: $CONTENT;"
83 if [[ -z $HTTP_USER_AGENT || $HTTP_USER_AGENT != *MSIE* ]]; then
84 # IE Can't handle ssl and zip files
85 echo "Pragma:no-cache"
86 fi
87
88 echo ""
98 eval "$COMMAND"


I debugged with set -x and here is the error log from the server:



 cat vmdb_zip_files_8862.err
+ [ 3 -lt 2 ]
+ CONTENT=application/x-zip-compressed
+ IFS=''
+ tr -d '~\'
+ echo /isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ FULL_DIRECTORY_PATH=/isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ printf 't'
+ IFS=$'t'
+ set -A FILE_LIST flight_dependent_heater_data_443949.txt flight_dependent_data_443949.txt
+ let count=0
+ (( 0 < 2 ))
+ FILE_LIST[0]='"flight_dependent_heater_data_443949.txt"'
+ let count='count +1'
+ (( 1 < 2 ))
+ FILE_LIST[1]='"flight_dependent_data_443949.txt"'
+ let count='count +1'
+ (( 2 < 2 ))
+ echo ' nt'
+ IFS=' nt'
+ [[ -n power_export.zip ]]
+ WEB_FILENAME=power_export.zip
+ [[ /isweb/www/ss/issapt/vmdb/data_downloads/power_export == *..* ]]
+ [[ /isweb/www/ss/issapt/vmdb/data_downloads/power_export == *~* ]]
+ [[ $'flight_dependent_heater_data_443949.txttflight_dependent_data_443949.txt' == *..* ]]
+ [[ $'flight_dependent_heater_data_443949.txttflight_dependent_data_443949.txt' == *~* ]]
+ [[ ! -f /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ [[ ! -d /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ [[ ! -r /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ COMMAND='cd "/isweb/www/ss/issapt/vmdb/data_downloads/power_export"; zip -rX - "flight_dependent_heater_data_443949.txt" "flight_dependent_data_443949.txt"'
+ echo 'Content-Type: application/x-zip-compressed;'
+ [[ -z 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' ]]
+ [[ 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' != *MSIE* ]]
+ echo Pragma:no-cache
+ echo ''
+ eval 'cd "/isweb/www/ss/issapt/vmdb/data_downloads/power_export"; zip -rX - "flight_dependent_heater_data_443949.txt" "flight_dependent_data_443949.txt"'
+ cd /isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ zip -rX - flight_dependent_heater_data_443949.txt flight_dependent_data_443949.txt
eval: zip: cannot execute [Exec format error]









share|improve this question









New contributor




Chris M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • the script (and thus zip) is executing on a RH Linux host? Was zip installed via a package or compiled manually? (It has the appearance of a wrong-architecture binary). The output of file /usr/bin/zip and uname -m would help.
    – Jeff Schaller
    2 mins ago















up vote
0
down vote

favorite












First off, our development environment just got upgraded to RHEL 7.5 (Maipo), we were previously on Oracle Solaris 10. Once we switched from Solaris to Red Hat this problem began. The Korn shell script below works correctly in production which is still on Solaris 10. So I am assuming that has something to do with the issue. The zip files that are being zipped up and downloaded are not saving to the zip folder. When I open the zip folder on the desktop that I just downloaded the zip folder is empty.



The pic below shows the file list. The user will select a checkbox for the files they want to download and then they click the zip and download link and it should zip up those selected files and save it to your desktop. Unfortunately the zip folder is empty. Any ideas what the problem may be? Any help will be appreciated, Thanks.



enter image description here



Here is the shell script that is being called below:



 1 #!/bin/ksh
2 #
3 # Utility to zip up files in the configuration_aerodynamic_properties area.
4 # Script takes two arguments the directory and the file list.
5 # The file list is tab seperated.
6 # This script returns the zip file.
7 #
8 # $Log: vmdb_zip_files.sh,v $
9 # Revision 1.4 2014/10/21 19:53:31 wmorris1
10 # ASR 13563 - Change incorrect mime type text/text to text/plain.
11 #
12 # Revision 1.3 2012/04/30 18:46:03 wmorris1
13 # ASR 12774 - Fix SSL and IE issue found after going to SSL.
14 #
15 # Revision 1.2 2004/11/11 12:49:33 bmorris
16 # ASR 55414 - removed UNIX groups for zipped file.
17 #
18 # Revision 1.1 2004/10/18 20:10:32 bmorris
19 # Initial revision
20 #
21 #set -x
22 #set -v
23 function error_message
24 echo "Content-Type: text/plain;"
25 echo "Content-Disposition: attachment; filename="download_error.txt";"
26 COMMAND="unix2dos "
27 echo ""
28 echo "$($COMMAND <<-EOF
29 Error: $1
30
31 EOF
32 )"
33
34 if [ "$#" -lt 2 ]; then
35 error_message "Insufficient arguments to $(basename $0)!"
36 return 1
37 fi
38 CONTENT="application/x-zip-compressed"
39 # Parse the directory path.
40 # Internal Field Sep (IFS) empty, cause spaces in file names, directories are important
41 IFS=$""
42 FULL_DIRECTORY_PATH=$(echo "$1" | tr -d '~\')
43 # File lists are seperated by tabs, parse them
52 IFS=$(printf 't')
53 set -A FILE_LIST $2
54 # Make each of the file parameters in the file list protected.
55 let count=0
56 while (( $count < $#FILE_LIST[*] )); do
57 FILE_LIST[count]=""$FILE_LIST[count]""
58 let count="count +1"
59 done
60 # Reset the IFS to the default.
61 IFS=$(echo " nt")
62 if [[ -n $3 ]]; then
63 WEB_FILENAME="$3"
64 fi
65 # Don't let the user download stuff.
66 if [[ "$1" = *..* ]] || [[ "$1" = *~* ]] || [[ "$2" = *..* ]] || [[ "$2" = *~* ]]; then
67 error_message "Path $1/$2 violates security."
68 return 1
69 elif [[ ! -f $FULL_DIRECTORY_PATH ]] && [[ ! -d $FULL_DIRECTORY_PATH ]]; then
70 error_message "$FULL_FILE_PATH does not exist or is not regular."
71 return 1
72 elif [[ ! -r $FULL_DIRECTORY_PATH ]]; then
73 error_message "$FULL_FILE_PATH is not readable from the web."
74 return 1
75 fi
76 # Zip up the f
79 COMMAND="cd "$FULL_DIRECTORY_PATH"; zip -rX - $FILE_LIST[*]"
82 echo "Content-Type: $CONTENT;"
83 if [[ -z $HTTP_USER_AGENT || $HTTP_USER_AGENT != *MSIE* ]]; then
84 # IE Can't handle ssl and zip files
85 echo "Pragma:no-cache"
86 fi
87
88 echo ""
98 eval "$COMMAND"


I debugged with set -x and here is the error log from the server:



 cat vmdb_zip_files_8862.err
+ [ 3 -lt 2 ]
+ CONTENT=application/x-zip-compressed
+ IFS=''
+ tr -d '~\'
+ echo /isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ FULL_DIRECTORY_PATH=/isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ printf 't'
+ IFS=$'t'
+ set -A FILE_LIST flight_dependent_heater_data_443949.txt flight_dependent_data_443949.txt
+ let count=0
+ (( 0 < 2 ))
+ FILE_LIST[0]='"flight_dependent_heater_data_443949.txt"'
+ let count='count +1'
+ (( 1 < 2 ))
+ FILE_LIST[1]='"flight_dependent_data_443949.txt"'
+ let count='count +1'
+ (( 2 < 2 ))
+ echo ' nt'
+ IFS=' nt'
+ [[ -n power_export.zip ]]
+ WEB_FILENAME=power_export.zip
+ [[ /isweb/www/ss/issapt/vmdb/data_downloads/power_export == *..* ]]
+ [[ /isweb/www/ss/issapt/vmdb/data_downloads/power_export == *~* ]]
+ [[ $'flight_dependent_heater_data_443949.txttflight_dependent_data_443949.txt' == *..* ]]
+ [[ $'flight_dependent_heater_data_443949.txttflight_dependent_data_443949.txt' == *~* ]]
+ [[ ! -f /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ [[ ! -d /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ [[ ! -r /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ COMMAND='cd "/isweb/www/ss/issapt/vmdb/data_downloads/power_export"; zip -rX - "flight_dependent_heater_data_443949.txt" "flight_dependent_data_443949.txt"'
+ echo 'Content-Type: application/x-zip-compressed;'
+ [[ -z 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' ]]
+ [[ 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' != *MSIE* ]]
+ echo Pragma:no-cache
+ echo ''
+ eval 'cd "/isweb/www/ss/issapt/vmdb/data_downloads/power_export"; zip -rX - "flight_dependent_heater_data_443949.txt" "flight_dependent_data_443949.txt"'
+ cd /isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ zip -rX - flight_dependent_heater_data_443949.txt flight_dependent_data_443949.txt
eval: zip: cannot execute [Exec format error]









share|improve this question









New contributor




Chris M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • the script (and thus zip) is executing on a RH Linux host? Was zip installed via a package or compiled manually? (It has the appearance of a wrong-architecture binary). The output of file /usr/bin/zip and uname -m would help.
    – Jeff Schaller
    2 mins ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











First off, our development environment just got upgraded to RHEL 7.5 (Maipo), we were previously on Oracle Solaris 10. Once we switched from Solaris to Red Hat this problem began. The Korn shell script below works correctly in production which is still on Solaris 10. So I am assuming that has something to do with the issue. The zip files that are being zipped up and downloaded are not saving to the zip folder. When I open the zip folder on the desktop that I just downloaded the zip folder is empty.



The pic below shows the file list. The user will select a checkbox for the files they want to download and then they click the zip and download link and it should zip up those selected files and save it to your desktop. Unfortunately the zip folder is empty. Any ideas what the problem may be? Any help will be appreciated, Thanks.



enter image description here



Here is the shell script that is being called below:



 1 #!/bin/ksh
2 #
3 # Utility to zip up files in the configuration_aerodynamic_properties area.
4 # Script takes two arguments the directory and the file list.
5 # The file list is tab seperated.
6 # This script returns the zip file.
7 #
8 # $Log: vmdb_zip_files.sh,v $
9 # Revision 1.4 2014/10/21 19:53:31 wmorris1
10 # ASR 13563 - Change incorrect mime type text/text to text/plain.
11 #
12 # Revision 1.3 2012/04/30 18:46:03 wmorris1
13 # ASR 12774 - Fix SSL and IE issue found after going to SSL.
14 #
15 # Revision 1.2 2004/11/11 12:49:33 bmorris
16 # ASR 55414 - removed UNIX groups for zipped file.
17 #
18 # Revision 1.1 2004/10/18 20:10:32 bmorris
19 # Initial revision
20 #
21 #set -x
22 #set -v
23 function error_message
24 echo "Content-Type: text/plain;"
25 echo "Content-Disposition: attachment; filename="download_error.txt";"
26 COMMAND="unix2dos "
27 echo ""
28 echo "$($COMMAND <<-EOF
29 Error: $1
30
31 EOF
32 )"
33
34 if [ "$#" -lt 2 ]; then
35 error_message "Insufficient arguments to $(basename $0)!"
36 return 1
37 fi
38 CONTENT="application/x-zip-compressed"
39 # Parse the directory path.
40 # Internal Field Sep (IFS) empty, cause spaces in file names, directories are important
41 IFS=$""
42 FULL_DIRECTORY_PATH=$(echo "$1" | tr -d '~\')
43 # File lists are seperated by tabs, parse them
52 IFS=$(printf 't')
53 set -A FILE_LIST $2
54 # Make each of the file parameters in the file list protected.
55 let count=0
56 while (( $count < $#FILE_LIST[*] )); do
57 FILE_LIST[count]=""$FILE_LIST[count]""
58 let count="count +1"
59 done
60 # Reset the IFS to the default.
61 IFS=$(echo " nt")
62 if [[ -n $3 ]]; then
63 WEB_FILENAME="$3"
64 fi
65 # Don't let the user download stuff.
66 if [[ "$1" = *..* ]] || [[ "$1" = *~* ]] || [[ "$2" = *..* ]] || [[ "$2" = *~* ]]; then
67 error_message "Path $1/$2 violates security."
68 return 1
69 elif [[ ! -f $FULL_DIRECTORY_PATH ]] && [[ ! -d $FULL_DIRECTORY_PATH ]]; then
70 error_message "$FULL_FILE_PATH does not exist or is not regular."
71 return 1
72 elif [[ ! -r $FULL_DIRECTORY_PATH ]]; then
73 error_message "$FULL_FILE_PATH is not readable from the web."
74 return 1
75 fi
76 # Zip up the f
79 COMMAND="cd "$FULL_DIRECTORY_PATH"; zip -rX - $FILE_LIST[*]"
82 echo "Content-Type: $CONTENT;"
83 if [[ -z $HTTP_USER_AGENT || $HTTP_USER_AGENT != *MSIE* ]]; then
84 # IE Can't handle ssl and zip files
85 echo "Pragma:no-cache"
86 fi
87
88 echo ""
98 eval "$COMMAND"


I debugged with set -x and here is the error log from the server:



 cat vmdb_zip_files_8862.err
+ [ 3 -lt 2 ]
+ CONTENT=application/x-zip-compressed
+ IFS=''
+ tr -d '~\'
+ echo /isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ FULL_DIRECTORY_PATH=/isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ printf 't'
+ IFS=$'t'
+ set -A FILE_LIST flight_dependent_heater_data_443949.txt flight_dependent_data_443949.txt
+ let count=0
+ (( 0 < 2 ))
+ FILE_LIST[0]='"flight_dependent_heater_data_443949.txt"'
+ let count='count +1'
+ (( 1 < 2 ))
+ FILE_LIST[1]='"flight_dependent_data_443949.txt"'
+ let count='count +1'
+ (( 2 < 2 ))
+ echo ' nt'
+ IFS=' nt'
+ [[ -n power_export.zip ]]
+ WEB_FILENAME=power_export.zip
+ [[ /isweb/www/ss/issapt/vmdb/data_downloads/power_export == *..* ]]
+ [[ /isweb/www/ss/issapt/vmdb/data_downloads/power_export == *~* ]]
+ [[ $'flight_dependent_heater_data_443949.txttflight_dependent_data_443949.txt' == *..* ]]
+ [[ $'flight_dependent_heater_data_443949.txttflight_dependent_data_443949.txt' == *~* ]]
+ [[ ! -f /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ [[ ! -d /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ [[ ! -r /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ COMMAND='cd "/isweb/www/ss/issapt/vmdb/data_downloads/power_export"; zip -rX - "flight_dependent_heater_data_443949.txt" "flight_dependent_data_443949.txt"'
+ echo 'Content-Type: application/x-zip-compressed;'
+ [[ -z 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' ]]
+ [[ 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' != *MSIE* ]]
+ echo Pragma:no-cache
+ echo ''
+ eval 'cd "/isweb/www/ss/issapt/vmdb/data_downloads/power_export"; zip -rX - "flight_dependent_heater_data_443949.txt" "flight_dependent_data_443949.txt"'
+ cd /isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ zip -rX - flight_dependent_heater_data_443949.txt flight_dependent_data_443949.txt
eval: zip: cannot execute [Exec format error]









share|improve this question









New contributor




Chris M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











First off, our development environment just got upgraded to RHEL 7.5 (Maipo), we were previously on Oracle Solaris 10. Once we switched from Solaris to Red Hat this problem began. The Korn shell script below works correctly in production which is still on Solaris 10. So I am assuming that has something to do with the issue. The zip files that are being zipped up and downloaded are not saving to the zip folder. When I open the zip folder on the desktop that I just downloaded the zip folder is empty.



The pic below shows the file list. The user will select a checkbox for the files they want to download and then they click the zip and download link and it should zip up those selected files and save it to your desktop. Unfortunately the zip folder is empty. Any ideas what the problem may be? Any help will be appreciated, Thanks.



enter image description here



Here is the shell script that is being called below:



 1 #!/bin/ksh
2 #
3 # Utility to zip up files in the configuration_aerodynamic_properties area.
4 # Script takes two arguments the directory and the file list.
5 # The file list is tab seperated.
6 # This script returns the zip file.
7 #
8 # $Log: vmdb_zip_files.sh,v $
9 # Revision 1.4 2014/10/21 19:53:31 wmorris1
10 # ASR 13563 - Change incorrect mime type text/text to text/plain.
11 #
12 # Revision 1.3 2012/04/30 18:46:03 wmorris1
13 # ASR 12774 - Fix SSL and IE issue found after going to SSL.
14 #
15 # Revision 1.2 2004/11/11 12:49:33 bmorris
16 # ASR 55414 - removed UNIX groups for zipped file.
17 #
18 # Revision 1.1 2004/10/18 20:10:32 bmorris
19 # Initial revision
20 #
21 #set -x
22 #set -v
23 function error_message
24 echo "Content-Type: text/plain;"
25 echo "Content-Disposition: attachment; filename="download_error.txt";"
26 COMMAND="unix2dos "
27 echo ""
28 echo "$($COMMAND <<-EOF
29 Error: $1
30
31 EOF
32 )"
33
34 if [ "$#" -lt 2 ]; then
35 error_message "Insufficient arguments to $(basename $0)!"
36 return 1
37 fi
38 CONTENT="application/x-zip-compressed"
39 # Parse the directory path.
40 # Internal Field Sep (IFS) empty, cause spaces in file names, directories are important
41 IFS=$""
42 FULL_DIRECTORY_PATH=$(echo "$1" | tr -d '~\')
43 # File lists are seperated by tabs, parse them
52 IFS=$(printf 't')
53 set -A FILE_LIST $2
54 # Make each of the file parameters in the file list protected.
55 let count=0
56 while (( $count < $#FILE_LIST[*] )); do
57 FILE_LIST[count]=""$FILE_LIST[count]""
58 let count="count +1"
59 done
60 # Reset the IFS to the default.
61 IFS=$(echo " nt")
62 if [[ -n $3 ]]; then
63 WEB_FILENAME="$3"
64 fi
65 # Don't let the user download stuff.
66 if [[ "$1" = *..* ]] || [[ "$1" = *~* ]] || [[ "$2" = *..* ]] || [[ "$2" = *~* ]]; then
67 error_message "Path $1/$2 violates security."
68 return 1
69 elif [[ ! -f $FULL_DIRECTORY_PATH ]] && [[ ! -d $FULL_DIRECTORY_PATH ]]; then
70 error_message "$FULL_FILE_PATH does not exist or is not regular."
71 return 1
72 elif [[ ! -r $FULL_DIRECTORY_PATH ]]; then
73 error_message "$FULL_FILE_PATH is not readable from the web."
74 return 1
75 fi
76 # Zip up the f
79 COMMAND="cd "$FULL_DIRECTORY_PATH"; zip -rX - $FILE_LIST[*]"
82 echo "Content-Type: $CONTENT;"
83 if [[ -z $HTTP_USER_AGENT || $HTTP_USER_AGENT != *MSIE* ]]; then
84 # IE Can't handle ssl and zip files
85 echo "Pragma:no-cache"
86 fi
87
88 echo ""
98 eval "$COMMAND"


I debugged with set -x and here is the error log from the server:



 cat vmdb_zip_files_8862.err
+ [ 3 -lt 2 ]
+ CONTENT=application/x-zip-compressed
+ IFS=''
+ tr -d '~\'
+ echo /isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ FULL_DIRECTORY_PATH=/isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ printf 't'
+ IFS=$'t'
+ set -A FILE_LIST flight_dependent_heater_data_443949.txt flight_dependent_data_443949.txt
+ let count=0
+ (( 0 < 2 ))
+ FILE_LIST[0]='"flight_dependent_heater_data_443949.txt"'
+ let count='count +1'
+ (( 1 < 2 ))
+ FILE_LIST[1]='"flight_dependent_data_443949.txt"'
+ let count='count +1'
+ (( 2 < 2 ))
+ echo ' nt'
+ IFS=' nt'
+ [[ -n power_export.zip ]]
+ WEB_FILENAME=power_export.zip
+ [[ /isweb/www/ss/issapt/vmdb/data_downloads/power_export == *..* ]]
+ [[ /isweb/www/ss/issapt/vmdb/data_downloads/power_export == *~* ]]
+ [[ $'flight_dependent_heater_data_443949.txttflight_dependent_data_443949.txt' == *..* ]]
+ [[ $'flight_dependent_heater_data_443949.txttflight_dependent_data_443949.txt' == *~* ]]
+ [[ ! -f /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ [[ ! -d /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ [[ ! -r /isweb/www/ss/issapt/vmdb/data_downloads/power_export ]]
+ COMMAND='cd "/isweb/www/ss/issapt/vmdb/data_downloads/power_export"; zip -rX - "flight_dependent_heater_data_443949.txt" "flight_dependent_data_443949.txt"'
+ echo 'Content-Type: application/x-zip-compressed;'
+ [[ -z 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' ]]
+ [[ 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' != *MSIE* ]]
+ echo Pragma:no-cache
+ echo ''
+ eval 'cd "/isweb/www/ss/issapt/vmdb/data_downloads/power_export"; zip -rX - "flight_dependent_heater_data_443949.txt" "flight_dependent_data_443949.txt"'
+ cd /isweb/www/ss/issapt/vmdb/data_downloads/power_export
+ zip -rX - flight_dependent_heater_data_443949.txt flight_dependent_data_443949.txt
eval: zip: cannot execute [Exec format error]






linux zip






share|improve this question









New contributor




Chris M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Chris M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 3 mins ago









Jeff Schaller

33.8k851113




33.8k851113






New contributor




Chris M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 10 mins ago









Chris M

1




1




New contributor




Chris M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Chris M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Chris M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • the script (and thus zip) is executing on a RH Linux host? Was zip installed via a package or compiled manually? (It has the appearance of a wrong-architecture binary). The output of file /usr/bin/zip and uname -m would help.
    – Jeff Schaller
    2 mins ago

















  • the script (and thus zip) is executing on a RH Linux host? Was zip installed via a package or compiled manually? (It has the appearance of a wrong-architecture binary). The output of file /usr/bin/zip and uname -m would help.
    – Jeff Schaller
    2 mins ago
















the script (and thus zip) is executing on a RH Linux host? Was zip installed via a package or compiled manually? (It has the appearance of a wrong-architecture binary). The output of file /usr/bin/zip and uname -m would help.
– Jeff Schaller
2 mins ago





the script (and thus zip) is executing on a RH Linux host? Was zip installed via a package or compiled manually? (It has the appearance of a wrong-architecture binary). The output of file /usr/bin/zip and uname -m would help.
– Jeff Schaller
2 mins ago
















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Chris M is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474902%2fksh-shell-script-zip-command-not-working-correctly-eval-zip-cannot-execute-e%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes








Chris M is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















Chris M is a new contributor. Be nice, and check out our Code of Conduct.












Chris M is a new contributor. Be nice, and check out our Code of Conduct.











Chris M is a new contributor. Be nice, and check out our Code of Conduct.













 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474902%2fksh-shell-script-zip-command-not-working-correctly-eval-zip-cannot-execute-e%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?