简体   繁体   English

相同名称的两个不同命令

[英]Two different command with the same name

In OsX i've 2 programs installed in different path with the same terminal name "scmd". 在OsX中,我以相同的终端名称“ scmd”在不同的路径中安装了2个程序。 If I put the bin folder of each one into the global path, when I run a terminal and type "scmd" only the first founded will run, and I have no way to run the other. 如果将每个文件夹的bin文件夹放入全局路径,则在运行终端并键入“ scmd”时,只有第一个被创建的文件夹会运行,而我无法运行另一个文件夹。

So I need to change the name of the second executable, like "scmd2". 因此,我需要更改第二个可执行文件的名称,例如“ scmd2”。 In that way i can type "scmd" to run the first and "scmd2" to run the second. 这样,我可以键入“ scmd”运行第一个,并输入“ scmd2”运行第二个。

How can I do? 我能怎么做?

Thanks a lot, I hope I explained. 非常感谢,我希望我能解释一下。

Create an alias: 创建一个别名:

alias scmd2=/path/of/second/binary

To have it permanent, store it in your ~/.bashrc file. 要使其永久存在,请将其存储在~/.bashrc文件中。

You can see all the paths for that binary with: 您可以使用以下命令查看该二进制文件的所有路径:

which scmd -a

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Intellij 正在合并两个同名文件夹 - Intellij is merging two folders with the same name 两个不同大小的NSTableCellView以相同的大小显示 - Two NSTableCellView with different sizes appearing with the same size Automator / AppleScript在同一目录中查找具有不同扩展名的相同文件名 - Automator/AppleScript to find same file name with different extension in same directory 在多个文件上运行命令并保持相同的名称 - Running a command over several files and keep the same name Mac终端命令:以相同名称开头的文件安全地移动到垃圾箱 - Mac Terminal Command: Move file starting with same name to trash safely Excel Visual Basic - 如果填充了同一列中的两个单元格,则执行命令 - Excel Visual Basic - executing a command if two cells in the same column are populated 如何使用 find 命令在不同的 maxdepth 搜索两个目录? - How to use find command to search two directories at different maxdepth? Xcode-根据目标导入具有相同名称的不同头文件 - Xcode - Importing different header file with same name based on Target 可可伐木工人如何用不同的文件名在同一文件夹中写入 - Cocoa Lumberjack how to write in same folder with different file name 自动脚本化两个具有相同名称的文件夹,但其中一个文件夹带有前缀 - Auto scripting two folders with the same name, but 1 folder appended with a prefix
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM