0

Trying the following:

#!sh

#$ -S /bin/bash 

#$ -t 1-8 

if [ ! -e ~/home/output.$SGE_TASK_ID ] 

then ~/fastqc -i ~/home/input.$SGE_TASK_ID -o ~/home/output.$SGE_TASK_ID

fi

Getting error:

.bash_array: line 7: [: missing `]'

Any ideas? Thanks!

jub0bs
  • 60,866
  • 25
  • 183
  • 186
  • what's the value of that variable? – glenn jackman Oct 05 '16 at 19:46
  • 2
    Does your script have DOS line endings? If so, the last argument on that line is `]\r`, not `]` – chepner Oct 05 '16 at 19:47
  • The value of the variable is 1 – LacquerHead Oct 05 '16 at 19:52
  • quick fix assuming @chepner guessed your problem correctly: try adding semicolons to the ends of your lines. – webb Oct 05 '16 at 20:06
  • @webb That's not a fix, just a way to trigger a different error. – chepner Oct 05 '16 at 20:09
  • Yes I get similar errors when doing that. – LacquerHead Oct 05 '16 at 20:10
  • aw too bad. then here's how to convert your script's line endings: http://stackoverflow.com/questions/2613800/how-to-convert-dos-windows-newline-crlf-to-unix-newline-n-in-bash-script (and in future, if you write your scripts in cygwin using eg `nano`, `pico`, `vi`, `vim`, or `emacs` instead of Notepad, this shouldn't be a problem). – webb Oct 05 '16 at 20:14

0 Answers0