Go Back   MacRumors Forums > Apple Systems and Services > Mac Basics and Help

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 25, 2013, 03:16 PM   #1
Riverrun
macrumors regular
 
Join Date: Jul 2007
Location: ~
Messed up Terminal

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.
Attached Thumbnails
Click image for larger version

Name:	Terminal.jpg
Views:	17
Size:	47.2 KB
ID:	392497  
Riverrun is offline   0 Reply With Quote
Old Jan 25, 2013, 03:26 PM   #2
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Riverrun View Post
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.
LPZ is offline   0 Reply With Quote
Old Jan 25, 2013, 03:43 PM   #3
Riverrun
Thread Starter
macrumors regular
 
Join Date: Jul 2007
Location: ~
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$
Riverrun is offline   0 Reply With Quote
Old Jan 25, 2013, 03:49 PM   #4
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Riverrun View Post
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.
LPZ is offline   0 Reply With Quote
Old Jan 25, 2013, 03:54 PM   #5
Riverrun
Thread Starter
macrumors regular
 
Join Date: Jul 2007
Location: ~
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$
Riverrun is offline   0 Reply With Quote
Old Jan 25, 2013, 03:55 PM   #6
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Riverrun View Post
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.
LPZ is offline   0 Reply With Quote
Old Jan 25, 2013, 03:56 PM   #7
Riverrun
Thread Starter
macrumors regular
 
Join Date: Jul 2007
Location: ~
Ok, TY
Riverrun is offline   0 Reply With Quote
Old Jan 25, 2013, 03:57 PM   #8
Dweez
macrumors 65816
 
Dweez's Avatar
 
Join Date: Jun 2011
Location: Down by the river
Move your .bash_profile out of the way and try again.
__________________
sudo make me a sandwich
Dweez is offline   0 Reply With Quote
Old Jan 25, 2013, 04:00 PM   #9
Riverrun
Thread Starter
macrumors regular
 
Join Date: Jul 2007
Location: ~
Getting rid of the .bash_profile might do the trick.

Would sudo rm .bash_profile work?
Riverrun is offline   0 Reply With Quote
Old Jan 25, 2013, 04:06 PM   #10
ChristianJapan
macrumors Demi-God
 
ChristianJapan's Avatar
 
Join Date: May 2010
Location: 日本
Quote:
Originally Posted by Riverrun View Post
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.
__________________
Member of MacRumors.com Folding@Home Team (#3446) & developer of the F@H Mobile Monitoring app.
ChristianJapan is offline   0 Reply With Quote
Old Jan 25, 2013, 04:12 PM   #11
Riverrun
Thread Starter
macrumors regular
 
Join Date: Jul 2007
Location: ~
I got it, folks. Thanks for the help. I deleted all four bash profiles and things are back to normal.
Riverrun is offline   0 Reply With Quote
Old Jan 25, 2013, 04:15 PM   #12
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Riverrun View Post
Ok, TY
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.
LPZ is offline   0 Reply With Quote
Old Jan 25, 2013, 04:36 PM   #13
Riverrun
Thread Starter
macrumors regular
 
Join Date: Jul 2007
Location: ~
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.
Riverrun is offline   0 Reply With Quote
Old Jan 25, 2013, 04:40 PM   #14
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Riverrun View Post
Thanks LPZ. The wierd stuff is gone and the fixow command works a treat.
You're welcome. Be careful with Terminal!
LPZ is offline   0 Reply With Quote
Old Jan 25, 2013, 05:35 PM   #15
Shrink
macrumors Demi-God
 
Shrink's Avatar
 
Join Date: Feb 2011
Location: New England, USA
Quote:
Originally Posted by LPZ View Post
You're welcome. Be careful with Terminal!
Terminal is a deep dark scary place.

Abandon hope, all ye who enter there...
Attached Thumbnails
Click image for larger version

Name:	Max Schreck.png
Views:	15
Size:	93.2 KB
ID:	392526  
__________________
Two things are infinite, the universe and human stupidity; and I'm not sure about the universe. -- Albert Einstein
Shrink is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Mac Basics and Help

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
So I messed up... bmehilos PowerPC Macs 1 Jan 12, 2014 03:57 AM
General: FIX "Error opening terminal: xterm-256color" for Terminal Commands (e.g., "top") iOS7 thelatinist Jailbreaks and iOS Hacks 9 Jan 10, 2014 08:46 PM
Terminal terminal-ology geohump Mac Applications and Mac App Store 0 May 17, 2013 01:40 PM
Messed up!!!! Haha1363 iPod touch 8 Aug 14, 2012 02:40 PM
I Really Messed Something Up!!! Purple2012 OS X 10.8 Mountain Lion 14 Jul 27, 2012 01:29 AM

Forum Jump

All times are GMT -5. The time now is 03:11 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC