Social and professional networking

View Ian Clarke's profile on LinkedIn
Shameless plug

Does your company's revenue depend on being able to predict the future based on past data?  SenseArray may be able to help.

RSS
Links
« Infinite complexity from simplicity | Main | A good pretty-printer for Google Gson »
Friday
30Oct2009

Simple bash script to name a tab in iTerm

I like to open a lot of tabs in iTerm, the open source replacement for Apple's Terminal.app on the Mac. Unfortunately, its easy to forget which is which, as typically they don't get very descriptive names.

In particular, I have a few scripts I run which will automatically ssh into a remote server, and run screen. When I wanted to find one of these, I'd often have to click several tabs to see which one I wanted (since they would all, rather unhelpfully, be called "ssh").

So I wrote a simple script, which I call "nametab", which allows you to name the tab you are in from the command line. You just type something like:

$ nametab New tab name
If you'd like to use this yourself, here is the code: Just put it in a file in your PATH, and ensure that it is executable (ie. do a chmod u+x nametab).

Reader Comments (1)

You might also take a look at:
screen_ssh

You could specify the command executed when you ssh in to a specific host, or all hosts. Something like (see line with LocalCommand):

[drowe@drowe][H:9448][J:0]> more config
HOST *
PermitLocalCommand yes
LocalCommand /home/drowe/.ssh/screen_ssh.sh $PPID %n
ServerAliveInterval 240

But, you might have already known this. :)

November 16, 2009 | Unregistered CommenterDennis

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>