我想在我的~/.bash_profile遗嘱中创建一个别名:
$1 $2diffless我还没有在 Stack 上找到任何可以满足我需要的解决方案,但请向我指出您知道的任何解决方案!以下几行出现在 my 中~/.bash_profile:
alias reload='. ~/.bash_profile'
alias aliases='emacs ~/.bash_profile; reload'
function dif () { diff "$1" "$2" | less; }
alias different='dif'
Run Code Online (Sandbox Code Playgroud)
当我尝试:
gsuehr$ reload
-bash: /Users/gregorysuehr/.bash_profile: line 93: syntax error: unexpected end of file
Run Code Online (Sandbox Code Playgroud)
我确定我不了解如何使用 bash 函数。reload aliases如果我注释掉函数声明,我已经确认 2 个别名:按预期工作。任何人都可以分享有关以下方面的知识: