test_capture: line 1: syntax error: "(" unexpected

majid
hi all

what is problem "./test_capture: line 1: syntax error: "(" unexpected"?


[root@FriendlyARM /]# cd sdcard
[root@FriendlyARM /sdcard]# ls
mjpg-streamer     s3c2440camera.ko  test_capture
[root@FriendlyARM /sdcard]# chmod u+x s3c2440camera.ko 
[root@FriendlyARM /sdcard]# chmod u+x test_capture 
[root@FriendlyARM /sdcard]# insmod s3c2440camera.ko 
[root@FriendlyARM /sdcard]# ./test_capture 
./test_capture: line 1: syntax error: "(" unexpected
[root@FriendlyARM /sdcard]# 


regards

majid
s3c2440camera has built with linux-2.6.29
mini2440 Kernel is 2.6.29.4-FriendlyARM on (/dev/pts/0)

mohan
line 1: syntax error: "(" unexpected
 got same when I run some executable

mohan
cross compile your code  arm-linux-gcc. I mean use cross complier

mohan
masjid

line 1: syntax error: "(" unexpected is solved just
cross compile your code  using arm-linux-gcc. I mean use cross complier

shaco
compile your program with:
arm-linux-gcc -o target sourcecode

marcovaldo
suppose your crosscompiling or linking didn't work at all.
I got exacly the same error message when my lazarus/fpc cross arm 
compiler was not set up correctly (and produced some kind of error file
or wrong type of linker file)
This file is what your target tries to execute(or at least display)

amol
how to cross compile the test_capture file by using arm-linux-gcc

arun
Im working with arm DM3730 in that i wrote a shell script for testing gpio
by led .... i got the same error /bin/led.sh: line 3: syntax error: "("
unexpected





#!/bin/sh

GPIO_min=( 70 88 140 116 55 17 12 158 161 )
GPIO_max=( 85 91 143 119 58 20 13 159 162 )

        for ((i=0; i < 9; i++)); do

                for ((j=${GPIO_min[i]}; j < ${GPIO_max[i]}; j++)); do
                        echo $j > /sys/class/gpio/export
                        sleep .5
                        echo out > /sys/class/gpio/gpio$j/direction
                        sleep .5
                        echo 1 > /sys/class/gpio/gpio$j/value
                        sleep .5

                        echo 0 > /sys/class/gpio/gpio$j/value
                        sleep .5
                        echo 1 > /sys/class/gpio/gpio$j/value
                        sleep .5
                  done

        done
~                                                                          
                                                 
~