0

Whenever I start a new Terminal session, the window opens up with a command:

'-bash: cd: /Users/yourusername/Library/lejos_nxj: No such file or directory'.

I want to remove that line from coming up on the prompt, so I deleted the Terminal plist file and sent hard resets, but nothing has worked for me so far.

Is there anything I haven't tried yet?

random
  • 9,774
  • 10
  • 66
  • 83
Sung Oh
  • 1
  • 1
  • When you open a terminal in OS X, it tries to execute the following files in order: `/etc/profile`, `/etc/bashrc`, `/Users/jano/.profile` (jano is my username). Open each of them and look for `nxj` which is the prefix for all NXJ commands and variables. – Jano Jul 08 '11 at 21:40

4 Answers4

1

You've probably got something in your ~/.profile, which is automatically executed when you open a Terminal.

If you did not set anything in there, do

rm ~/.profile

in a Terminal and this should disappear.

If you think that something important may be in there, do

open -a TextEdit ~/.profile

(or change TextEdit to your preferred editor) to view and edit the file.

nobody
  • 4,074
  • 1
  • 23
  • 33
  • 1
    I wouldn't do that, as other programs can put things in that file. I'd search through `~/.profile` first. – Chris Gregg Jul 08 '11 at 20:59
  • For reference, the only program I ever encountered that added something important to `~/.profile` was MacPorts. – nobody Jul 08 '11 at 21:22
  • Thanks! I found the culprit at /.bash_profile. Deleting that fixed up my Terminal. – Sung Oh Jul 08 '11 at 21:47
0

That line is probably in either your ~/.bashrc file or your ~/.profile file. I would check those two files first (and they are both hidden because of the period initial character).

Edit: I just checked my OS X system, and I don't have ~/.bashrc (but you may).

Chris Gregg
  • 2,376
  • 16
  • 30
0

You could try a terminal replacement (Just recently read about this one, iTerm2) it might resolve your problem by using its own default startup settings.

If it is anything like Linux the ~/.bashrc and ~/.profile are used when you open your terminal.

Kevin Jalbert
  • 3,115
  • 3
  • 26
  • 39
0

It seems that most people assume it is in some init file but its not clear which are included. Once your shell does come up (ignore errors) -try this:

script
bash -l -x
exit
exit

Now you should have a file called typescript which will have debug info showing most if not all of what the shell has executed when coming up in login mode. You could for instance do grep source typescript to see which files were involved OR you could find refrences to nxj etc.

p.s. I assume your clearing of the plist would clear the preferences, but wouldn't hurt to see if the relevant command is in 'Terminal-> Presences->Settings->Shell->Run Command' for any of the terminal window presets

nhed
  • 5,774
  • 3
  • 30
  • 44