One possible explanation to what you are seeing is that the command generates output only to stderr and no output to stdout.
You have done something like this:
mysql [...] >> log.txt
which means that you are redirecting stdout to the log.txt file. However, any output to stderr will still appear directly in your terminal, it will not go to the log.txt file. Usually, error messages are output to stderr so if there are some error messages resulting from your mysql command then it is likely that those will be output to stderr rather than stdout.
You could try this instead:
mysql [...] >> log.txt 2>> err_log.txt
(just add "2>> err_log.txt" to the end of your command line)
that means that you are now requesting stdout to be redirected to the log.txt file, as before, but now you are also redirecting stderr to the err_log.txt file.
More about this here: https://stackoverflow.com/questions/7526971/how-to-redirect-both-stdout-and-stderr-to-a-file
Also here: https://stackoverflow.com/questions/876239/how-can-i-redirect-and-append-both-stdout-and-stderr-to-a-file-with-bash
$baseName.sql
? Iflog.txt
is empty, then your command isn't producing any output. – terdon Mar 28 '19 at 10:39mysql --host="$ipAddr" -u "$usr" -p -t < "$baseName.sql"
provides output? If not ... nothing ends up in log.txt. Also make sure log.txt is at a location you can write to. – Rinzwind Mar 28 '19 at 10:48