Hi!
We are migrating some shell scripts from unix to linux and we are bsolutely newby. Some scripts invoke slq scripts which contain instructions for operations on a syabase database that we are migrating to sql server database, so we are rewriting these sql scripts as well. Our new shell scripts call directly the sqlcmd command and already pass db server, db name, user and password stored in environment variables:
sqlcmd -S $SERVER_DB -d $NAME_DB -U $USER_DB -P $PASSW_DB < /home/scripts/update_data.sql
but at the first line of each sql script we need to convert, we are finding similar statement:
isql -U$DBUSER -P$DBPASSWD -w 80<< EOF|grep -v "return status" >>/usr/local/abc/ABC.txt
Perhaps because for some users a certain connection to the syabase database was set by default, so it was sufficient to put the call to the isql command on the first line of the sql file passing only the user and password, but in our case using sqlcmd we already pass everything directly in the shell script, it is not necessary to invoke the sqlcmd command again at the first line of the sql script. So what should we write in place of isql call but leaving the part that redirects the output to the ABC.txt file? Thanks in advance