简体   繁体   中英

Snowsql script not executed when run as here document from bash script

I have a bash script that contains something like this:

snowsql -a <account> -u <user> --authenticator externalbrowser -d <dbname> -o quiet=false <<-EOF
!source foo.sql
EOF

When I run it I don't see any of the output from the commands in foo.sql on the screen. It also appears that none of the SQL in foo.sql is executed (not reflected in state of database). Terminal output is:

* SnowSQL * v1.2.13
Type SQL statements or !help
Goodbye!

If I run foo.sql from an interactive Snowsql session the output from foo.sql is shown and the database is updated accordingly.

Why is foo.sql not executed when called in batch mode from the bash script?

As @Gokhan says this looks to be down to the authentication method. Authentication via a non-browser method makes the problem go away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM