【问题标题】:commands in .bash-profile do not work.bash-profile 中的命令不起作用
【发布时间】:2010-11-15 18:46:16
【问题描述】:

我在 Mac Leopard 上的主目录中的 .bash_profile 文件中添加了一个别名。例如,

alias preview = "open -a preview"
alias lsall = "ls -l"

当我尝试从命令行运行这些命令时,我收到 command not found 的消息

知道我可能做错了什么吗?谢谢!

【问题讨论】:

  • 对不起!会去那里看看属于那里的。

标签: macos bash terminal


【解决方案1】:

你只需要去掉=周围的空格,即

alias preview="open -a preview"
alias lsall="ls -l"

如果您希望在启动新 shell 时自动执行该文件,您还需要将文件命名为 .bash_profile

【讨论】:

    最近更新 更多