Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Getting command output to putty window title. Post 302948055 by domagaj on Thursday 25th of June 2015 07:35:14 AM
Old 06-25-2015
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 tweaks with wait delays and for some commands that worked for others not. XSEL and XCLIP couldn't be installed on that server.

So here is the solution:
1. Get command output in a file.
2. Echo that file to title.

on putty client and suse server it looks like this:
Code:
ls /home | grep domagaja > logutoit.txt 
echo -e "\033]0\\;$(cat logutoit.txt)\\007\\c"

Hopefully someone will be able to use this. It won't work for all server types and putty client settings, of course, but the idea should work well.
Best
Jacek


Moderator's Comments:
Mod Comment Please use code tags next time for your code and data, thanks

Last edited by vbe; 06-25-2015 at 08:40 AM..
These 2 Users Gave Thanks to domagaj For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

window title..?

how to echo some text onto the window title bar...in exceed client...so that we can know where we are in..in multiple hostnames kinda..thing.. any advice.. (1 Reply)
Discussion started by: tintedwindow
1 Replies

2. 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

3. 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

4. UNIX for Advanced & Expert Users

Change title of aixterm window online

Is there any way to change title of aixterm window online? Also is it possible to freeze first/last few lines online? (1 Reply)
Discussion started by: Soham
1 Replies

5. 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

6. 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

7. Linux

how to insert a title into a window in kshell

hi all, i am using a Ubuntu work station. i have following piece of code that works ok. But i cant figure out a way to insert a string call $Name into the title of the window i am opening. As you can see, i tried two different ways without a success. Can someone please help me out here? :( ... (3 Replies)
Discussion started by: usustarr
3 Replies

8. 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

9. UNIX for Dummies Questions & Answers

Change putty title name

Hello all, I have a not so unix question for you guys(or maybe it is). I use PUTTY to login to serverA (my putty title shows as serverA.domainname.com) Now from ServerA i do ssh user@ServerB (i have ssh public private key setup)... now my question is when i do ssh and logon to... (20 Replies)
Discussion started by: abdul.irfan2
20 Replies

10. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies
SIMPLEXML_LOAD_STRING(3)						 1						  SIMPLEXML_LOAD_STRING(3)

simplexml_load_string - Interprets a string of XML into an object

SYNOPSIS
SimpleXMLElement simplexml_load_string (string $data, [string $class_name = "SimpleXMLElement"], [int $options], [string $ns = ""], [bool $is_prefix = false]) DESCRIPTION
Takes a well-formed XML string and returns it as an object. PARAMETERS
o $data - A well-formed XML string o $class_name - You may use this optional parameter so that simplexml_load_string(3) will return an object of the specified class. That class should extend the SimpleXMLElement class. o $options - Since PHP 5.1.0 and Libxml 2.6.0, you may also use the $options parameter to specify additional Libxml parameters. o $ns - Namespace prefix or URI. o $is_prefix - TRUE if $ns is a prefix, FALSE if it's a URI; defaults to FALSE. RETURN VALUES
Returns an object of class SimpleXMLElement with properties containing the data held within the xml document, or FALSE on failure. Warning This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. ERRORS
/EXCEPTIONS Produces an E_WARNING error message for each error found in the XML data. Tip Use libxml_use_internal_errors(3) to suppress all XML errors, and libxml_get_errors(3) to iterate over them afterwards. EXAMPLES
Example #1 Interpret an XML string <?php $string = <<<XML <?xml version='1.0'?> <document> <title>Forty What?</title> <from>Joe</from> <to>Jane</to> <body> I know that's the answer -- but what's the question? </body> </document> XML; $xml = simplexml_load_string($string); print_r($xml); ?> The above example will output: SimpleXMLElement Object ( [title] => Forty What? [from] => Joe [to] => Jane [body] => I know that's the answer -- but what's the question? ) At this point, you can go about using $xml->body and such. SEE ALSO
simplexml_load_file(3), SimpleXMLElement::__construct, "Dealing with XML errors", libxml_use_internal_errors(3), "Basic SimpleXML usage". PHP Documentation Group SIMPLEXML_LOAD_STRING(3)
All times are GMT -4. The time now is 04:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy