如何在窗口中的git-bash中执行命令,这些命令位于具有空格的文件夹中,即“Program Files”? [英] How can I execute commands in git-bash in windows which are located in a folder with spaces ie "Program Files"?

查看:974
本文介绍了如何在窗口中的git-bash中执行命令,这些命令位于具有空格的文件夹中,即“Program Files”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用git bash时,我不时要调用一个命令,它在我的 $ PATH (实际上在我的 PATH%),但如果命令驻留在包含空格的文件夹中的某处,则无法运行。

When I use git bash, from time to time I want to invoke a command wich is on my $PATH ( well actually on my %PATH% ) but if the command resides somewhere in a folder with spaces on it, it fails to run.

C:\Program Files \whatever\aCmd.exe 上,我在bash上键入 aCmd 程序不是有效的程序等。

For instance if the program is on C:\Program Files\whatever\aCmd.exe and I type aCmd on bash, it says "Program" is not a valid program and such.

我所做的是在一个没有空格的文件夹中重新安装程序,但最近我的同事开始离开git-gui并使用git-bash和循环问题是如何执行aCmd,当我告诉他们重新安装它,他们就像¬¬

What I did was to re-install the program in a folder without spaces, but recently my coworkers are starting to leave git-gui and are using git-bash and the recurrent question is "How do I execute aCmd" and when I tell them to re-install it they go like ¬¬

Q。如何在git-bash中执行位于具有空格的文件夹中的命令?

Q. How can I execute commands in git-bash which are located in a folder with spaces?

推荐答案

只需将命令在双引号之间执行即可,

Just put the command to execute between double quotes, like so

"C:\Program Files\whatever\aCmd.exe"

这篇关于如何在窗口中的git-bash中执行命令,这些命令位于具有空格的文件夹中,即“Program Files”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆