Simple question...

sfish

Fark Lover
I'm trying to fire off a long command in Terminal by typing in a much shorter command. For example:

I'd like to be able to type:

smgo

and have it resolve to:

smbclient \\\\xxx.xxx.xxx.xxx -W DomainName

Another Mac person at the office who also knows a bit about Unix told me to add .profile to my homedir with this content:

alias smgo=smbclient \\\\xxx.xxx.xxx.xxx -W DomainName

I did this and it didn't work. Yes, I've restarted Terminal and even rebooted.

Thanks for any help in getting this to work!
 
If your using the default shell (tcsh) you can edit your .tcshrc file.

Open or create the .tcshrc file in your home directory and add:

alias smgo smbclient \\\\xxx.xxx.xxx.xxx -W DomainName

Hope this helps,
 
Cool! That seems to work.

So why didn't my office mate's suggestion work? Why did he suggest .profile? Was the "=" superfluous?

Oh, BTW, although I've been putzing around in various flavors of Unix for quite a number of years, I've never done much more than simple Web and Work related commands (cd, ls -al, various SCCS commands, mkdir, pico, vi, etc...). I appreciate everyone's help getting this "veteran newbie" pushed further into Unix knowledge.
 
You said you use ls -al. Try typing ll in X. It is aliased to ls -alg !* | more which is very useful as it lists everything one screen at a time.
 
<blockquote><i>So why didn't my office mate's suggestion work? Why did he
suggest .profile? Was the "=" superfluous?</i></blockquote>

Well, it depends on the shell that you are using.
Look in the "Shell" panel of the preferences of the OSX
Terminal application to see what shell you are using.

.tcshrc is the user - preference startup file that your
shell (tcsh) reads on startup every time that you open a
new terminal window.

If you were using csh ("C shell") as your shell, it would
look for your startup config info in .cshrc

If you were using sh ("bourne shell") or bash, it would look
for .profile

Just for correctness, I will also add that if tcsh starts up
and does not find .tcshrc, it will try to read .cshrc

For more info on this, see the "Startup and shutdown" section
of the tcsh man page.

All the best,
DouglasDD
 
Back
Top