The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Putty Input thru Windows JACKDSOUZA Shell Programming and Scripting 2 04-10-2008 02:55 AM
Shell Script to ftp from windows server shilpa.rajput Shell Programming and Scripting 8 11-07-2007 12:52 AM
How to take printout of linux file from windows xp using putty? sathyguy Red Hat 3 02-21-2007 02:21 AM
copying files and Renaming them + shell script pathanjalireddy Shell Programming and Scripting 7 06-08-2005 05:08 AM
How to execute a shell script from Windows kyawlin UNIX for Dummies Questions & Answers 4 12-19-2003 09:54 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-23-2006
orno orno is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 21
Smile Renaming putty windows with a shell script

i frequently have to open multiple putty windows to ssh into a unix server running HP-UX 11.23. Since i use some of the windows for dedicated processes i would like to rename them (the caption displayed in the titlebar) to something more convenient than the standard <Host>.<Server>.com

While researching on how to do this, I came across this site: http://www.mail-archive.com/screen-u.../msg00331.html

This works fine when I run the command from the command line, but I wanted to make a shell script so that I can just say something like 'settitle.sh This is window 1' and it would rename that particular window to "This is window 1"

I made the following script (settitle.sh) for this:


Code:
#!/bin/sh

params=$*
PROMPT_COMMAND='echo -ne "\033]0; $params \007"'

I created an alias to this script in my profile:


Code:
alias title='. $SCRIPTS/settitle.sh'

Now this is what I dont understand:
If i say
Code:
title This is window 1

the title of my window gets set accordingly

However if I say

Code:
./settitle.sh This is window 2

nothing happens

If i try calling the settitle.sh script through another script, its the same thing: nothing happens....

Now I've just started off scripting a few weeks ago so I'm not an expert or anything but this has got me stumped...

Anyone got any ideas?

Last edited by orno; 10-23-2006 at 11:02 AM..
  #2 (permalink)  
Old 10-23-2006
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Quote:
alias title='. $SCRIPTS/settitle.sh'

./settitle.sh This is window 2
The second one is running the script in a child process. Try from the directory that the settile.sh script is in:

. ./settitle.sh This is window 2
  #3 (permalink)  
Old 10-23-2006
orno orno is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 21
brilliant

i should have read the Bash basics before starting off :P

Thanks!
  #4 (permalink)  
Old 11-25-2008
provkitir provkitir is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 1
Could you please post your script settitle.sh?

The original link is no longer accessible, and I am having the same issue with SSH.

Thanks a lot in advance,
  #5 (permalink)  
Old 11-25-2008
orno orno is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 21
its up there in my first post, as well as here below now


Code:
#!/bin/sh

params=$*
PROMPT_COMMAND='echo -ne "\033]0; $params \007"'

have fun!
Closed Thread

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0