Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode bash:运行exe所需的exe的完整路径?_Xcode_Bash_Console - Fatal编程技术网

Xcode bash:运行exe所需的exe的完整路径?

Xcode bash:运行exe所需的exe的完整路径?,xcode,bash,console,Xcode,Bash,Console,我在下面的路径/Users/user1/bin中有一个Xcode可执行文件“testexe”/ 如果我试图在终端应用程序(控制台)中通过在bash提示符中键入testexe从当前目录运行可执行文件,则会出现错误“bash:testexe:command not found” 但是,当我提供完整路径/Users/user1/bin/testexe时,它会按预期运行。即使我的当前目录已经是/Users/user1/bin。为什么?将/Users/user1/bin/添加到PATH变量中 export

我在下面的路径/Users/user1/bin中有一个Xcode可执行文件“testexe”/ 如果我试图在终端应用程序(控制台)中通过在bash提示符中键入testexe从当前目录运行可执行文件,则会出现错误“bash:testexe:command not found”


但是,当我提供完整路径/Users/user1/bin/testexe时,它会按预期运行。即使我的当前目录已经是/Users/user1/bin。为什么?

/Users/user1/bin/
添加到PATH变量中

export PATH=$PATH:/Users/user1/bin/

然后运行textexe

如果您在包含exe的目录中,则需要使用./testexe,因为当前目录不在您的路径中