Change putty title name


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Change putty title name
# 8  
Old 04-23-2012
Remove the /bin/ from sh and hope sh's in the path, I guess.

And that kind of function only works in a few certain shells. What's your shell?
# 9  
Old 04-23-2012
Sorry I just now saw you use ksh. I have mksh and it allows local but you must split that to two lines. I am not well read on ksh.
Code:
local args
args=( "$@" )

edit: that function is by no means a complete wrapper. many ssh options take arguments (i.e. ssh -p 123 user@host). if you never use options, the function can be made a lot simpler (always use $1 as title), otherwise it can be made a lot lengthier to shift through them.

Last edited by neutronscott; 04-23-2012 at 03:10 PM..
# 10  
Old 04-23-2012
Quote:
Originally Posted by neutronscott
Sorry I just now saw you use ksh. I have mksh and it allows local but you must split that to two lines. I am not well read on ksh.
Code:
local args
args=( "$@" )

edit: that function is by no means a complete wrapper. many ssh options take arguments (i.e. ssh -p 123 user@host). if you never use options, the function can be made a lot simpler (always use $1 as title), otherwise it can be made a lot lengthier to shift through them.
Thank you for your help...but seems like still giving my same or similar issue...

Code:
$ cat test.sh
ssh() {
local args
args=( "$@" )
        #try find out destination
        while [[ $1 = -* ]]; do shift; done

        printf '\033]0;%s\007' "$1"
        command ssh "${args[@]}"
        printf '\033]0;%s\007' "$USER@$HOSTNAME"
}
$
$
$ ./test.sh
./test.sh: syntax error at line 3 : `(' unexpected
$
$

Moderator's Comments:
Mod Comment Code tags for code, please.

Last edited by Corona688; 04-23-2012 at 05:08 PM..
# 11  
Old 04-23-2012
Try
Code:
function ssh
{
...
}

# 12  
Old 04-23-2012
Quote:
Originally Posted by Corona688
Try
Code:
function ssh
{
...
}

Same thing...
# 13  
Old 04-23-2012
Still no ksh wizard? is ksh88 or ksh93? try
Code:
set -A args "$@"

# 14  
Old 04-23-2012
Quote:
Originally Posted by neutronscott
Still no ksh wizard? is ksh88 or ksh93? try
Code:
set -A args "$@"

Thanks, atleast past though one stage..or the main one...but when i exit out..the title remains the same as ServerB....and i get below....


Code:
servername:/home/oracle> exit
logout
Connection to servername closed.
ssh[8]: HOSTNAME: parameter not set
$


Last edited by Scrutinizer; 04-23-2012 at 06:39 PM.. Reason: code tags
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Change title of a thread after it is created

hi, how do we change the title of a thread after it is created? Thanks (5 Replies)
Discussion started by: milhan
5 Replies

2. UNIX for Dummies Questions & Answers

Getting command output to putty window title.

Hi, Last 2 weeks I have searched many forums and i haven't found the answer for the question: How to get all command output to Putty title? Needed it for other programs to know when some jobs on a server is done and is it done right or wrong. Plink stdout and stdin wasn't working, i used many... (1 Reply)
Discussion started by: domagaj
1 Replies

3. Shell Programming and Scripting

Remotely setting putty window title

I have successfully used a script to modify putty's window title for many years. It has worked great in a Solaris 10 environment, using, sh, bash and tcsh. But I've never been able to get it to work in linux :( The script relies on sending escape sequences via gnu echo. The version of echo on... (4 Replies)
Discussion started by: tsreyb
4 Replies

4. AIX

How to change cronjob title?

Once I type "mail" command, I got to see the mail like below: > 1 daemon Thu Aug 12 17:31 31/938 "Output from cron job " My question is, how to do change the default title "Output from cron job " to be more customized title? Thanks. (4 Replies)
Discussion started by: ngaisteve1
4 Replies

5. Shell Programming and Scripting

How do I Get the Title of My Putty Window (Emulating an XTerm)

I have a Perl script that changes the terminal window title and I would like to reset it to the original value when I am done. We are using Putty which emulates xterm. We are not running X-Windows so I can't use something like xprop (can I?). I'm using XTerm control codes to change the title and I... (2 Replies)
Discussion started by: NateTut
2 Replies

6. UNIX for Advanced & Expert Users

PuTTY TITLE

Is it possible to set the PuTTY title to show the current hostname of the terminal opened? I meant to say I would be rlogin between servers, that should be updated in PuTTTY title ? :confused: (4 Replies)
Discussion started by: ./hari.sh
4 Replies

7. UNIX for Advanced & Expert Users

putty title window?

I have implemented the solution from mschwage located in post https://www.unix.com/unix-advanced-expert-users/35784-change-putty-title-window.html; ie wt () { echo -n "^2;${@}^G" } This method is awesome!!!! The reason I am sending you this message is to get your assistance with... (3 Replies)
Discussion started by: lwif
3 Replies

8. UNIX for Advanced & Expert Users

Change putty title window?

Is it possible to change the putty window title from a Unix command line? (12 Replies)
Discussion started by: akbar
12 Replies

9. Solaris

Change Terminal Title

Is it possible to change the title of a Terminal window on Solaris? For example, for a MS Windows command window, one can simply type "title NameofWindow" to change the title for a command window. I was looking for similar functionality for terminal windows. Thanks. (8 Replies)
Discussion started by: here2learn
8 Replies

10. UNIX for Dummies Questions & Answers

Change Console Title

Hello. I am trying to figure out how to change the title of my console window. I don't need it to dynamically change with my current directory. I just want to be able to change the name of it, so when I minimize the window I can see which windows are for what purpose. I've tried using the... (8 Replies)
Discussion started by: medmonson
8 Replies
Login or Register to Ask a Question