BASH login problem

ksignorini

Registered
My Users dir is currently located on a second hard disk which is mounted as "/Volumes/Data HD". When I run BASH as "bash --login" or as my actual login shell (changing the shell parameter in the NetInfo record for my user account) I get the following message when I launch a shell:

[: /Volumes/Data: binary operator expected

I believe that there is a script running somewhere that uses the "[" command that is having a hard time resolving the fact that my user dir is located on a partion with a space in it's name ("Data HD" has a space character before the "HD" part).

Can anyone tell me what script this might be?

If I had some idea where to look, I might be able to fix the script to handle the space better.

I suppose I could grep the entire hard disk for "[" but I probably won't get very far in finding the exact script.

Thanks for your help,
Kent!
 
The four files I would check first are these:

/etc/profile
/etc/bashrc
~/.profile
~/.bashrc

It seems odd that the space would be handled improperly in a script when it's just doing some variable substitution. It can probably be fixed with some single quote trickery once you find the problem.
 
Howdy!

It looks as though your partition name has a space in it. Bash (and unix shells in general) really don't spaces in volume names. Try renaming your volume to "Data_HD" or "DataHD".

I suspect that will clear up the issue.

bob.
 
One more thing.. the "[" character is a part of the prompt. It isn't the problem (I think).. I would remove the space.

bob.
 
Well, I've renamed my partition to "Data_HD" with the underscore (to remove the space) and fixed up my /Users symlink and used niutil to repoint my user definition to the correct user dir (now /Volumes/Data_HD/Users/ka5) and...

no luck. Same thing.

I think that some startup script for login shells only (when I run bash as an interactive standard shell and not a login shell it doesn't happen) is using the "[" command somewhere and it's just not being used right. Perhaps it's not space related at all...just a bad script if the user dir is on another partition.

Does anyone know which script bash runs besides /etc/profile and /etc/bashrc that could be causing the problem? Like I said, it's login shell related since it only happens if I use bash as my default login shell or if I run bash with "bash -login".

Thanks,
Kent!
 
Back
Top