Ask Your Question
0

syntax error near unexpected token `('

asked 2013-07-02 08:40:22 -0500

Roli gravatar image

updated 2013-07-03 05:33:20 -0500

FranciscoD_ gravatar image

Hi guys.

I wanted to run the "source get_libs" command for the following program named "get_libs" (it's a part of another package and I'm following the instructions from the guide of that package):

#*! usr/local/bin/tcsh
set file='zlibs.dat'
foreach line (`awk '{print $1";"$2}' $file`)
   set z=`echo $line | awk 'BEGIN {FS=";"} {print $2}'`
   echo $z "70.,0.30,0.70" | xargs -n 1 | ./get_optic_colors
   echo $z "70.,0.30,0.70" | xargs -n 1 | ./get_infrared_colors

end

But when I type source get_libs, I receive this error:

bash: get_libs: line 5: syntax error near unexpected token `('
bash: get_libs: line 5: `foreach line (`awk '{print $1";"$2}' $file`)'

The information of my system are: Linux User 3.9.7-100.fc17.i686 #1 SMP Fri Jun 21 18:06:22 UTC 2013 i686 i686 i386 GNU/Linux

I'm also a bash user.

Can you please help me what should I do?

Thank you for your help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-07-02 09:44:17 -0500

davidcl gravatar image

You can not "source" a tcsh script in bash ; to use it just switch to tcsh then "source" this script.

$ sudo yum install tcsh
$ tcsh
$ source get_libs
edit flag offensive delete link more

Comments

Thank you. It worked :)

Roli gravatar imageRoli ( 2013-07-02 10:25:30 -0500 )edit

Question Tools

Stats

Asked: 2013-07-02 08:40:22 -0500

Seen: 2,129 times

Last updated: Jul 03 '13