这可能是一个无聊的问题,但我无法找到我完全理解的以下查询的答案。
我搬到了一个新的研究所,我正在访问我的研究虚拟机。我想创建一个方便的bashrc,让生活更轻松。
因此,使用以下命令编辑〜/ .bashrc文件:
alias lhcb = "cd ~/vols/lhcb/bd1316/B2ppKgamma/"
alias work_space = "cd ~/home/hep/bd1316/Public/Project/"
alias Code = "cd ~/home/hep/bd1316/Public/Project/Scripts/"
并打开一个新终端以使用更新的bashrc文件我收到以下错误:
-bash: alias: alias: not found
-bash: alias: =: not found
-bash: alias: cd ~/vols/lhcb/bd1316/B2ppKgamma/: not found
-bash: alias: work_space: not found
-bash: alias: =: not found
-bash: alias: cd ~/home/hep/bd1316/Public/Project/: not found
-bash: alias: Code: not found
-bash: alias: =: not found
-bash: alias: cd ~/home/hep/bd1316/Public/Project/Scripts/: not found
我不明白出了什么问题。你能解释一下这个问题,如果可能的话,提供一个修复方法吗?很有责任。
答案 0 :(得分:3)
Bash变量声明不允许=
alias lhcb="cd ~/vols/lhcb/bd1316/B2ppKgamma/"
alias work_space="cd ~/home/hep/bd1316/Public/Project/"
alias Code="cd ~/home/hep/bd1316/Public/Project/Scripts/"
参考this链接。