0

this command run perfectly If i execute from my google cloud sdk shell on windows but if I put this command in a bash script this command fail!! Some idea?

gcloud config set project my-project-id

the error is:

D:\temp\bash test.sh

] is not a valid project ID.he project property must be set to a valid project ID, [bdtg-shared-infra-prod
Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
Arthur
  • 49
  • 1
  • 5
  • If you run `bash -x yourscript`, what exactly does the line it shows logging its gcloud invocation contain? Please make sure you're providing us with a [mcve] that generates that same logged line -- otherwise, you aren't giving us enough to truly reproduce the problem. – Charles Duffy Feb 20 '20 at 17:21
  • Actually, given that the string jumped back to the beginning of the line, what you have is almost certainly a CRLF DOS-style newline. – Charles Duffy Feb 20 '20 at 17:26
  • You can use VI to change the EOL character (which is your problem). `:set fileformat=unix` – John Hanley Feb 20 '20 at 18:28
  • Thanks a lot charles Duffy, I write again the command with nano editor and its executed successfully. This was a dum error – Arthur Feb 22 '20 at 00:14

0 Answers0