【问题标题】:How to make simple path with alias in .bash_profile (Mac)如何在 .bash_profile (Mac) 中使用别名创建简单路径
【发布时间】:2014-04-10 15:07:41
【问题描述】:

我在 mac 的 .bash_profile 中设置别名,如下所示:

别名 XMLtoMESH='/OgreSDK/OgreCommandLineToolsMac_1.8.0/OgreXMLConverter'

别名 OgreSource='~/garage-project/tryCV/tryOgre/tryOgre/media/Export/'

实际上,OgreXMLConverter 是命令行工具,但我只想用我自己的 (XMLtoMESH) 重命名它,它在文件开始执行时没有问题和问题。但是路径有点问题,因为我必须像这样 "~/garage-project/tryCV/tryOgre/tryOgre/media/Export/" 放置“长”路径来转换我的本机文件。所以,问题是,我如何让它变得简单,因为我尝试使用别名添加 .bash_profile,它无法正常工作。

提前致谢。

【问题讨论】:

    标签: macos path alias ogre .bash-profile


    【解决方案1】:

    路径不需要别名。你可以试试这个:

    OgreSource="$(echo $HOME)/garage-project/tryCV/tryOgre/tryOgre/media/Export/"

    并像这样使用它:

    cd ${OgreSource}

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-17
      • 2021-08-03
      • 1970-01-01
      • 2018-04-20
      • 2017-10-24
      • 2012-04-22
      • 2013-10-14
      相关资源
      最近更新 更多