Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Riverrun

macrumors regular
Original poster
Jul 11, 2007
145
1
~
Long story. Briefly: I have duplicates in the right-click menu and I wanted to set up a bash profile to get rid of them and messed up horribly. I would like to get terminal back to normal.
There is no .bash_profile in my home folder - it was probably the fact that I neglected to create one in the first place that got me into this mess. Terminal now opens in the way shown in the attachment.

Anyhow, I'm out of my dept and need some help.

Where is the "Open With has been rebuilt, Finder will relaunch stored"?
Where is the "chmod:fixow" command stored?

Is it safe to edit the file, assuming that I find it in the first place? Any help would be appreciated.
 

Attachments

  • Terminal.jpg
    Terminal.jpg
    47.2 KB · Views: 93

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
Long story. Briefly: I have duplicates in the right-click menu and I wanted to set up a bash profile to get rid of them and messed up horribly. I would like to get terminal back to normal.
There is no .bash_profile in my home folder - it was probably the fact that I neglected to create one in the first place that got me into this mess. Terminal now opens in the way shown in the attachment.

Anyhow, I'm out of my dept and need some help.

Where is the "Open With has been rebuilt, Finder will relaunch stored"?
Where is the "chmod:fixow" command stored?

Is it safe to edit the file, assuming that I find it in the first place? Any help would be appreciated.

Not sure if Terminal is usable enough, but please paste in

Code:
cd; ls -al

and post the output. Just copy and paste, no screenshot needed.
 

Riverrun

macrumors regular
Original poster
Jul 11, 2007
145
1
~
The output is as follows


Last login: Fri Jan 25 19:57:14 on ttys000
Open With has been rebuilt, Finder will relaunch
chmod: fixow: No such file or directory
Seans-Mac-mini:~ sean$ cd; ls -al
total 120
drwxr-xr-x+ 24 sean staff 816 25 Jan 19:10 .
drwxr-xr-x 5 root admin 170 25 Jul 2012 ..
-rw------- 1 sean staff 3 18 Apr 2012 .CFUserTextEncoding
-rw-r--r--@ 1 sean staff 21508 25 Jan 20:21 .DS_Store
drwx------ 5 sean staff 170 25 Jan 20:40 .Trash
-rw------- 1 sean staff 19 25 Jan 14:25 .bash_history
-rw-r--r-- 1 sean staff 265 23 Jan 15:07 .bash_profile
-rw------- 1 sean staff 248 23 Jan 14:57 .bash_profile.save
-rw------- 1 sean staff 248 23 Jan 15:00 .bash_profile.save.1
-rw------- 1 sean staff 235 23 Jan 15:05 .bash_profile.save.2
-rw------- 1 sean staff 265 23 Jan 15:09 .bash_profile.save.3
drwxr-xr-x 6 sean staff 204 11 Oct 18:53 .dvdcss
-rw------- 1 root staff 1024 25 Jan 2012 .rnd
drwxr-xr-x 6 sean staff 204 27 Jan 2012 .subversion
-rw------- 1 sean staff 679 30 Jul 14:57 .viminfo
drwx------+ 4 sean staff 136 25 Jan 20:17 Desktop
drwx------+ 16 sean staff 544 25 Jan 19:10 Documents
drwx------+ 8 sean staff 272 25 Jan 20:17 Downloads
drwx------@ 58 sean staff 1972 25 Jan 20:27 Library
drwx------+ 6 sean staff 204 25 Jan 19:10 Movies
drwx------+ 9 sean staff 306 25 Jan 19:10 Music
drwx------+ 9 sean staff 306 25 Jan 19:10 Pictures
drwxr-xr-x+ 5 sean staff 170 25 Jan 19:10 Public
drwxr-xr-x+ 3 sean staff 102 25 Jan 19:10 Sites
Seans-Mac-mini:~ sean$
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
The output is as follows


-rw-r--r-- 1 sean staff 265 23 Jan 15:07 .bash_profile
-rw------- 1 sean staff 248 23 Jan 14:57 .bash_profile.save
-rw------- 1 sean staff 248 23 Jan 15:00 .bash_profile.save.1
-rw------- 1 sean staff 235 23 Jan 15:05 .bash_profile.save.2
-rw------- 1 sean staff 265 23 Jan 15:09 .bash_profile.save.3

OK, you have .bash_profile. To see what's there, paste

Code:
cat ~/.bash_profile

into Terminal. Please post the output.
 

Riverrun

macrumors regular
Original poster
Jul 11, 2007
145
1
~
Thanks for the help.


Last login: Fri Jan 25 20:41:48 on ttys000
Open With has been rebuilt, Finder will relaunch
chmod: fixow: No such file or directory
Seans-Mac-mini:~ sean$ cat ~/.bash_profile
#!/bin/sh
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"
chmod ugo+rwx fixow

Seans-Mac-mini:~ sean$
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
Thanks for the help.


Last login: Fri Jan 25 20:41:48 on ttys000
Open With has been rebuilt, Finder will relaunch
chmod: fixow: No such file or directory
Seans-Mac-mini:~ sean$ cat ~/.bash_profile
#!/bin/sh
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"
chmod ugo+rwx fixow

Seans-Mac-mini:~ sean$

OK, the problem is in here. Let me take a look and I'll get back to you.
 

Riverrun

macrumors regular
Original poster
Jul 11, 2007
145
1
~
Getting rid of the .bash_profile might do the trick.

Would sudo rm .bash_profile work?
 

ChristianVirtual

macrumors 601
May 10, 2010
4,122
282
日本
Getting rid of the .bash_profile might do the trick.

Would sudo rm .bash_profile work?

Maybe first rename it into .bash_profile.sar. Or. .bash_profile.fixtrouble.

You might want to keep it for a while; just to be safe. Once all settled you still can delete that file later.
 

Riverrun

macrumors regular
Original poster
Jul 11, 2007
145
1
~
I got it, folks. Thanks for the help. I deleted all four bash profiles and things are back to normal.
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2

OK, here's what you want:

In Terminal, enter

Code:
cd; cat > .bash_profile

Then paste in the following long line:

Code:
alias fixow='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"'

Then press return and then control-d.

You should get a new command prompt.

Then paste in

Code:
. .bash_profile

Then to test, quit Terminal and restart it. The weird stuff should be gone. Then enter

Code:
fixow

and you should have what you were trying to do.
 

Riverrun

macrumors regular
Original poster
Jul 11, 2007
145
1
~
Thanks LPZ. The wierd stuff is gone and the fixow command works a treat.

I found it simpler to edit the .bash_profile with TextyWrangler, saved it as bash_profile.txt, moved it into my home folder, removed the extension and put a . before the bash_profile.

Works great and saves me a lot of trouble.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.