bash:C:/ Program:没有这样的文件或目录
我是Docker,Debezium,Bash和Kafka的新手。我正在尝试在Windows 10上运行Windows 10上的MSSQL Server的Debezium教程/示例:
I am new to Docker, Debezium, Bash, and Kafka. I am attempting to run the Debezium tutorial/example for MSSQL Server on Windows 10 here:
https://github.com/debezium/debezium-examples/blob/master/tutorial/README.md#using -sql-server
我能够按照第一步启动拓扑。但是,当我转到第二步并执行以下命令时:
I am able to start the topology, per step one. However, when I go to step two and execute the following command:
cat debezium-sqlserver-init/inventory.sql | docker exec -i tutorial_sqlserver_1 bash -c '/opt/mssql-tools/bin/sqlcmd -U sa -P $SA_PASSWORD'
我得到以下错误:
bash:C:/ Program:没有这样的文件或目录
bash: C:/Program: No such file or directory
我不知道为什么它甚至会将 C:/ Program
拖入这个。我没有在命令中看到它,也没有在* .sql文件中看到它。有人知道为什么会发生这种情况以及解决方法是什么吗?
I do not have the foggiest idea why it would even drag C:/Program
in to this. I do not see it in the command nor do I see it in the *.sql file. Does anyone know why this is happening and what the fix is?
注1:我已经在当前目录中,该命令可以运行,并且其中没有空格。文件夹/文件路径
Note 1: I am already in the current directory where this command should be runnable and there are no spaces in the folder/file path
注2:我正在Git Bash中运行命令
Note 2: I am running the commands in Git Bash
使用 set -x
记录命令的运行方式时,仍然没有 C:/ Program
在其中的任何位置,如以下日志所示:
When using set -x
to log how the command is run, there's still no C:/Program
anywhere in it, as can be seen by the following log:
$ cat debezium-sqlserver-init/inventory.sql | docker exec -i tutorial_sqlserver_1 bash -c '/opt/mssql-tools/bin/sqlcmd -U sa -P $SA_PASSWORD'
+ cat debezium-sqlserver-init/inventory.sql
+ docker exec -i tutorial_sqlserver_1 bash -c '/opt/mssql-tools/bin/sqlcmd -U sa -P $SA_PASSWORD'
bash: C:/Program: No such file or directory
昨天我遇到了类似的问题,解决方案是在绝对路径之前添加反斜杠,例如:
I had a similar problem yesterday, the solution was adding a backslash before the absolute path, like :
cat debezium-sqlserver-init/inventory.sql | docker exec -i tutorial_sqlserver_1 bash -c '\/opt/mssql-tools/bin/sqlcmd -U sa -P $SA_PASSWORD'
\ / opt / mssql-tools / bin / sqlcmd阻止转换为Windows路径。
\/opt/mssql-tools/bin/sqlcmd prevents conversion to Windows path.