I am looking for a QuickSilver way of doing the following on Mac:
$ sudo vi /etc/php.ini
Is it possible for me to open a file using TextEdit as super user?
Edit: I already know about Terminal plug-in, and it's great. But, I was hoping to use TextEdit without typing full path of TextEdit.
If you want to see that "Run a Text Command in Terminal" action as duffbeer703 shows, you'll have to add the Terminal plugin.
**Sorry, I didn't see that you wanted to run TextEdit instead of vi. In order to do that, do this:
Make a ~/bin folder (that's a folder named bin in your home directory).
Add ~/bin to your path by editing ~/.profile and adding the following two lines: PATH="~/bin:${PATH}" export PATH
Go into ~/bin and make a new file called TextEdit with the following line: sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit $1 &
Make that file executable by doing: chmod +x ~/bin/TextEdit
Now go back to QuickSilver and its "Run a Text Command in Terminal" thing and do the period thing to type in text, then type: TextEdit /etc/php.ini
A terminal will popup and ask for your sudo password. Once you put that in, TextEdit will pop up and let you edit as root.
There's probably an easier or cleaner way, but it does work.
It is possible.
Open Quicksilver, type "." and type "sudo vi /etc/php.ini"
Under Action you want to select "Run as Text Command in Terminal"
The "Process Manipulation Actions" plugin adds a "Launch as Root" action. You may need to enable the action after installing the plugin.
Here's what I ended up doing:
Yes, give up on the idea of
sudo
ing altogether.Next, open
/etc
in Finder by opening Quciksilver, navigate to Macintosh HD and pressingOption + /
. Double-click onphp.ini
from Finder to pick the application to open it with.To make
php.ini
show up in Quicksilver, I added a Custom catalog to/etc
with Include Contents set to Folder Contents and Depth set to 2.Now, all I have to do after invoking Quicksilver is to type "phpini" (without period) or "httpd" and hit enter.