2

Tried to run a few bq command from Git bash

the following code works

echo 'select 1' | bq query

while the following doesn't standard use in bash doesn't.

bq query "select 1"

the above command provide the following error

'C:\Program' is not recognized as an internal or external command, operable program or batch file.

Any idea to get the 2nd standard command working?

Anthony Liu
  • 343
  • 1
  • 12
  • Please post the error you get.. – Graham Polley Nov 04 '18 at 22:54
  • Do you run both commands under the exact same conditions? Could it be that you run each from a different directory? I am asking this cause it's weird how `bq` succeeds when you're piping to it but not when you call it directly. Could it be that you're running `echo 'select 1' | bq query` from within `google-cloud-sdk/bin/` and `bq query "select 1"` from another place? Then the problem would be that the `bq` executable is in a path starting with 'C:\Program' (I guess 'C:\Program Files'), so when it's looked up in `%PATH%` it throws the error due to the space character. – Lefteris S Nov 06 '18 at 11:42
  • Check [here](https://stackoverflow.com/questions/12891383/correct-quoting-for-cmd-exe-for-multiple-arguments) for more details on the issue with the space character. – Lefteris S Nov 06 '18 at 11:43

0 Answers0