busy girl thoughts

Geekie stuff, Shell, Unix, Terminal, MacJanuary 15, 2008 12:55 pm

Today I downloaded a command “class-dump“, but had no frig’n idea how to “install” it. What I did was I downloaded the file, expanded it and double clicked on the executable Terminal file, and a Terminal window popped up showing the usage of the command, and automatically logs out.

I tried executing the command in Terminal, and I got the error message “-bash: command not found”. I moved the directory to where ‘class-dump’ is located, and tried to execute there, and it failed for the same reason.

I googled “install shell command” “install unix command” and tons of other terms, but nobody included a dumbed-down, step-by-step instruction on how to do it.

So here’s how I finally did it-
go to Finder, menu bar “Go to Folder”,

and type in /usr/bin.

Here you’ll see all other commands. Then just copy and paste the file in here. It may tell you that you do not have permission to modify bin, and if that happens, click “authenticate”, and type in the administrator’s (my, in my case) password. Then go back to Terminal. You’ll be able to execute the command from any directory. It’s that simple.

Geekie stuff, Shell, Unix, Terminal, MacJuly 10, 2007 7:54 pm

Today I learned how to create javascripts in the Shell environment. Mike Chamber’s webpage is really helpful. In this article he mentioned this file”.bash_profile”, which I couldn’t find in my OS X terminal. After some researching I realized this is something we create: create a “.bash_profile” file under the root directory (for OS it’s User/YOUR USERNAME/), and whenever you open a terminal window, it’ll automatically execute the commands in the file. At first I used the text editor to write Mike Chamber’s modified .bash_profile, but I had to use the “Vi” editor in Shell to clean up some random symbols created by my texteditor. And voila, it worked!

From now on, I can directly execute javascript commands in my terminal. Here’s mozilla’s resource page on Rhino.