Hello,
I am pretty new with writing shell scripts and trying to use a script to perform some db2 commands on a CentOS 4 system. I get a problem when I put in my shell-file 'myscript.sh' the command:
db2 -tf somefile.sql
When executing, I get a DB2 error:
DB21004E You cannot specify both an input file and a command when invoking the Command Line Processor.
I discovered, using the debug command $ sh -x myscript.sh, that the shell adds some end of line symbols or something thet ruin the command, since the output gives:
+ db2 -tf ctb2.sql $'\r'
I fugured this post would be better placed here than at the DB2 section. Can anyone help me how to get rid of this unwanted addition?
Thanks in advance, Sietse
I am pretty new with writing shell scripts and trying to use a script to perform some db2 commands on a CentOS 4 system. I get a problem when I put in my shell-file 'myscript.sh' the command:
db2 -tf somefile.sql
When executing, I get a DB2 error:
DB21004E You cannot specify both an input file and a command when invoking the Command Line Processor.
I discovered, using the debug command $ sh -x myscript.sh, that the shell adds some end of line symbols or something thet ruin the command, since the output gives:
+ db2 -tf ctb2.sql $'\r'
I fugured this post would be better placed here than at the DB2 section. Can anyone help me how to get rid of this unwanted addition?
Thanks in advance, Sietse
Comment