Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

After an errant script in my .bash_profile created thousands of files on my computer and bogged it down to inoperable speeds I've managed to fix it by booting into single user mode and executing a find | rm combo. The offending script's pseudocode (which may look familiar to a recent post) is:

i=1
while(i > 0)
do
    i=++
    touch filename$i
done

While in SU I ran

fsck -fy
mount -uw

to allow for file system changes and deleted the impossible number of files. I have since removed the script from my bash profile as well. Although now my OSX partition runs smoothly, I cannot use my terminal, when launching it the error message:

login: -: Permission denied

[Process completed]

Does anybody have any insight into how I can fix the login permissions?

edit: I've tried using the repair permissions in Disk Utility, but to no avail.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Turns out after editing some stuff in single user mode my terminal was set to open the shell from the root directory. Cant do that, obviously. Changed it to the location of my .bash_profile and everything is working again. Guess I should look for the simple solution before assuming that something deep in the system was changed.

Edit: The fix was made in the preferences section of the Terminal App. I have the shell set to open with the Command (complete path) option. Before the fix the terminal was loading from / but now I have fixed it so that in my case the terminal opens from path ~/.bash_profile. Since my profile doesn't have direct access to / the login script failed with a permission denied message.

Sorry about the unclear answer!

share|improve this answer
    
Can you elaborate on "set to open the shell from the root directory"? –  Chris Page Nov 8 '11 at 8:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.