Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'much easier GUI way to do this!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
much easier GUI way to do this!
Authored by: tali on May 01, '01 02:17:57AM

That's great! I've been looking for a way to do this for a while! Now the question is, can I launch this shell from the terminal without having to go to the menu?

I want to be able to launch with one word commands different ssh sessions on other unix machines that pop up on my mac color-coded and with the appropriate title on the window.

You've brought me nearly there. Do you know how to run these "shellname.term" files from the terminal? I tried making them executable but that did not work...



[ Reply to This | # ]
much easier GUI way to do this!
Authored by: quentinsf on May 01, '01 06:15:20AM
Do you know how to run these "shellname.term" files from the terminal? I tried making them executable but that did not work...

The open command will do this for you. Have a look at its man page.


Quentin



[ Reply to This | # ]
re:much easier GUI way to do this!
Authored by: tali on May 01, '01 01:46:37PM

thanks! The open command was what I needed.

Now I have three different terminals with different title bars and colors letting me know what server they are from, and I can pop them up from the command line. I have the ssh key set up on the servers, so I don't have to give a password either. Just one command. Sweet!


-tali



[ Reply to This | # ]
set up an alias
Authored by: jmil on May 01, '01 09:57:54PM

you can write an alias so all you have to do is type a string like "connect", or anything you really want, and it will run any command of your choice. You will have to edit /private/etc/csh.cshrc as root. To avoid using emacs, vi, or anything else that is hard to understand, just type the following:
su
(enter your administration password here)

open -a /Applications/TextEdit.app/ /private/etc/csh.cshrc
(this tells the terminal to open csh.cshrc with TextEdit.app)

you should see a line that says "source /usr/share/init/tcsh/rc"
all you have to do is think of an alias, and type it in. Here is an example:

alias myfavorite "open /Users/myusername/Library/Terminal/mycustomterminal.term"

this creates the alias "myfavorite" such that when you type "myfavorite" in a terminal window, the terminal will execute the command in quotes and will thus open mycustomterminal.term. You won't have to type "open /Users/myusername/...." ever again!

edit until you're happy with your aliases. You could also add another command to this file such as:

alias myaliases "open -a /Applications/TextEdit.app/ /private/etc/csh.cshrc"
This will allow you to simply type su to become superuser, and then "myaliases" to open your csh.cshrc file in TextEdit.app.

Now File>Save

Now all you have to do is tell the terminal to recognize your new commands. you could restart the terminal, or simply type

source /private/etc/csh.cshrc

this will execute the csh.cshrc file, and the terminal will recognize your new aliases as commands. Now just type "myfavorite" anytime you want to execute that command.
If it doesn't work for some reason, just type "source /private/etc/csh.cshrc" again, or check that your syntax in csh.cshrc is correct.

Using aliases can make your work in the terminal extremely efficient, but also dangerous if you don't know what you're doing. I WOULDN'T recommend trying to combine "sudo" with any aliases you try to create. I hope this is clear. Let me know if it isn't, or if you need more help. Good Luck.

jmil



[ Reply to This | # ]
more tips
Authored by: jmil on May 01, '01 10:04:36PM

clarification:
aliases you add should each be on their own line, if you didn't know this already.
also, you can always type "alias" from any terminal window to see a list of aliases the system will recognize. After following my directions in my previous post, you should see your new aliases in this list. Hope that helps.

jmil



[ Reply to This | # ]