I think the latest version of FSL has this sorted out (it doesn't change your machine's POSIXLY_CORRECT setting except briefly in the middle of fsl_sub).

Peace,

Matt.

From: chenchunhuichina <chenchunhuichina@gmail.com>
Date: Friday, November 1, 2013 2:55 AM
To: Matt Glasser <matt@ma-tea.com>
Cc: free surfer <freesurfer@nmr.mgh.harvard.edu>
Subject: ERROR: comparison in expression (FS with SGE)

Dear Matt and freesurfers,
 
I am encounting this old problem, that is, using fsl_sub to launch FreeSurfer jobs in SGE and get this error message: (standard_in) 2: Error: comparison in expression 
and freesurfer stoped. But running freesurfer without fsl_sub is OK (using fsl_sub to launch other commonds also fine).
 
Following Matt's message on this problem https://mail.nmr.mgh.harvard.edu/pipermail/freesurfer/2012-May/023961.html, I added a line "POSIXLY_CORRECT=0 " in fsl_sub under  the line "set -- `getopt T:q:a:p:M:j:t:z:N:Fvm:l:s: $*`"
which now looks like this
...
set -- `getopt T:q:a:p:M:j:t:z:N:Fvm:l:s: $*`
POSIXLY_CORRECT=0 
...
 
However, the error was still the same, and what's even worse is that seems the job was launched twice.
 
So can Matt or anybody tell me why? Am I misunderstood Matt's message? or mybe version differences since Matt's solution came out one year ago?
I am using freesurfer-Linux-centos4_x86_64-stable-pub-v5.2.0, FMRIB Software Library, Release 5.0 (c) 2012
 
there are two fsLsub
./src/sgeutils/fsl_sub
./bin/fsl_sub
which one should I edit or both?
 
Any help is appreciated, Thank you all!
 
 
2013-11-01

Chunhui Chen
_________________
 
State Key Laboratory of Cognitive Neuroscience and Learning
Beijing Normal University
Beijing, China 100875