2

Basic problem: When I open a new tab in terminal, bash fails with the following error output:

bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `exec -la (null) (null) -1'

[Process completed]

In preferences, I have new tabs set to open with same settings/directory.

I've been messing around learning to customize the bash prompt area, actually in an attempt to fix this problem, but to no avail. I messed around with /etc/bashrc before I realized I should do that by user, I've reset that file to look like this:

# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
  return
fi

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
   update_terminal_cwd() {
       # Identify the directory using a "file:" scheme URL,
       # including the host name to disambiguate local vs.
       # remote connections. Percent-escape spaces.
       local SEARCH=' '
       local REPLACE='%20'
       local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
       printf '\e]7;%s\a' "$PWD_URL"
   }
   PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi

Finally, my ~/.bash_profile looks like this:

source /etc/bashrc

export PATH=~/Code:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin.

export CLASSPATH=~/Programs/:~/Programs/bailey.jar:~/Programs/labs/:.
export PYTHONPATH=~/dm/:~/Code/Git/.:.

If anyone can give me any suggestions, that would be wonderful.

4

2 回答 2

5

我也遇到了这个问题,发现我不小心更改了终端首选项的“启动”选项卡中的设置。设置为“Shell 打开方式:命令(完整路径):。”

我将它改回“Shell open with: Default login shell”并解决了问题。

于 2013-07-01T13:49:41.083 回答
0

只是对(已经非常有帮助的)线程的更新:我正在运行终端 2.5,现在有一个名为“新窗口打开方式:”的设置;

“相同的工作目录”

应该选择有利于

“默认工作目录”。

于 2015-01-19T23:04:46.510 回答