could u help me out? I run this on cygwin as ./test.sh and I get unexpected end of file on line 51. Any thoughts?
Thx in advance
LAST EDIT: final version ‘runnin on CygWin, the problem was with the line break, CrLf instead Lf.
#!/bin/sh ################################################## ## USAGE ################################################## if [ $# -ne 1 ]; then echo '1>Use Extractor: $0 <MODO DE OPERACAO>' echo '2>Use Extractor: $0 <MODO DE OPERACAO> <DATA INICIAL> <DATA FINAL>' exit 127 else if [ $1 -lt 0 ]; then if [ $1 -gt 1 ]; then echo '2>Use Extractor: $0 <MODO DE OPERACAO> <DATA INICIAL> <DATA FINAL>' exit 127 fi fi fi ################################################## ## VARS ################################################## ########################################## ## AUX ########################################## set java_cmd='' set java_cmd_emergencial='' set java_cp='' ########################################## ## JAR ########################################## set db_user='' set db_pwd='' set conn_string='' set work_dir='' set output_dir='' ################################################## ## PARAMETROS ################################################## set mode=$1 set data_ini='' set data_fim='' if [ $# -eq 3 ]; then set data_ini = $2 set data_fim = $3 fi ################################################## ## CHAMADA DO JAR ################################################## java '$java_cp' '$java_cmd' '$mode' '$db_user' '$db_pwd' '$conn_string' '$work_dir' '$output_dir'
If nothing else double-check that you have a newline at the end of the last line in the script.