On Fri, May 24, 2019 at 10:45 AM Chico Venancio chicocvenancio@gmail.com wrote:
sql is a cloud specific wrapper with some magic.
Making the path absolute as Cyberpower678 suggests should do the trick. Or using the mysql command if it has all needed parts should be good as well.
Thanks for all the attempts at debugging help folks! Krenair and I worked with Tom in the #wikimedia-cloud Freenode channel yesterday and eventually figured out his bug. It turned out to be a byte order mark (BOM) [0] in the script that he was preparing on a Windows host and uploading to the Toolforge bastion to execute. The BOM was invisible when using `cat` and `less` to look at the file, but it was confusing bash when interpreting the file contents. The execution was being done via `source the_script_file.txt` and the BOM was being interpreted as part of the command name. Bash was looking for `<BOM>sql` in the exec path rather than `sql`.
[0]: https://en.wikipedia.org/wiki/Byte_order_mark
Bryan