Issue Description:
On running a script, getting error as -
/apps/user/samplescript.sh: syntax error at line 4: `<<' unmatched
Script Code -
export param1=/app/user/bteqscripts.sh
echo $param1
bteq <<-END > /dev/null
.SET WIDTH 3000;
.RUN FILE = $param1;
Select date;
.QUIT;
END
Issue Resolution:
There were space/spaces before END and which was causing this issue.
Normally when we connect to thirdparty command from Unix like sftp, sqlplus, bteq, etc and want to pass the commands in the script we will need to use <<-TEXT. It will execute this commands till it finds TEXT. But One needs to make sure that there no leading and trailing spaces between TEXT, tabs are allowed though.
On running a script, getting error as -
/apps/user/samplescript.sh: syntax error at line 4: `<<' unmatched
Script Code -
export param1=/app/user/bteqscripts.sh
echo $param1
bteq <<-END > /dev/null
.SET WIDTH 3000;
.RUN FILE = $param1;
Select date;
.QUIT;
END
Issue Resolution:
There were space/spaces before END and which was causing this issue.
Normally when we connect to thirdparty command from Unix like sftp, sqlplus, bteq, etc and want to pass the commands in the script we will need to use <<-TEXT. It will execute this commands till it finds TEXT. But One needs to make sure that there no leading and trailing spaces between TEXT, tabs are allowed though.