当我执行时,source ~/.bash_profile我收到此错误:
line 14 syntax error: unexpected end of file
Run Code Online (Sandbox Code Playgroud)
我试图删除最后一行无济于事。
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi
PS1='\[\e[0;36m\]\W\[\e[m\]\[\e[1;31m\]\$\[\e[m\]'
if [ "$PS1" ]; then PS1="[\e[0;36m]\W\n[\e[m][\e[1;31m]\$[\e[m]" fi
function gi() { curl -L -s https://www.gitignore.io/api/$@ ;}
export LSCOLORS=cxfxcxdxbxegedabagacad
Run Code Online (Sandbox Code Playgroud) 在 Mac 终端上运行的这个 bash 文件无法更改目录。而是在实际存在时报告它不存在。我做错了什么吗?
#!/usr/bin/env bash
set -e
read name
APPLICATION_PATH="~/Documents/meteor/apps/$name"
cd "${APPLICATION_PATH}"
Run Code Online (Sandbox Code Playgroud)