04-01-2016
Hey guys, thanks for the replies. Much appreciated!
The sed command gave some strange results, and with the character locations not being preserved, I won't be able to find what I'm looking for in the file.
Thanks for the info on cat, but that just shows me what non-printing characters are in there and by removing the control chars it won't preserve how the text looks when printed using just 'cat filename.txt'....
I guess maybe this isn't possible..? I thought maybe it would be since the escape sequences are just re-arranging the text (*and inserting whitespace) and I can physically see how the formatted data SHOULD look when printed in the terminal. So I guess I kind of hoped I could just capture what is actually seen in the terminal and NOT what is unseen, like escape sequences/control-characters...
Thanks Again,
Matt
---------- Post updated at 06:52 PM ---------- Previous update was at 05:41 PM ----------
To explain a little better of what I'm trying to do see below, *maybe there is a simpler way....
So what the goal is, I'm trying get the output of the AIX command "topas" into a text file so I can grab one specific value... This command is very similar to the top command where it is an interactive command which just continuously updates the terminal window with new values every 2 seconds... Since it does that, that is why the control characters show up in the text file. They use the control characters to place the values correctly on the screen.
If you redirect topas to a text file and kill it right away, and then do a vi / view of the file the values are all over the place. It seems like it shows some of the Value's labels in the correct spot but their actual values could show up 20 lines below where it would be if you just did a 'cat' on the file.
I was praying topas had a command line switch similar to top's "-b" option for batch mode, but it does not...
There is a way to record the topas command's values with the topasrec command, but the output from that is harder to understand then just using topas. And I believe you need to use something like Excel to read that file....
I guess if there isn't another way I can just do what I'm already doing and see if that Label's value shows up on the exact same line everytime... If it does, I can just hard-code it in to capture that specific line and pull out the value... But, I guess we'll see.
Thanks Again,
Matt
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all
The makefile of a large project produces hundreds of lines of output, which I can't look at any more when the build is finished. If I simply redirect the output to a file, I can't see the progress of the building process...
Is there a possibility to redirect the output to a file and at... (1 Reply)
Discussion started by: Charlie
1 Replies
2. Solaris
I have a window open on my ultra 10 - a terminal window connecting to a server.
Is there any way I can log all output to this window to a log file on my ultra 10 ? (2 Replies)
Discussion started by: frustrated1
2 Replies
3. UNIX for Advanced & Expert Users
Hey,
How can I transfer the terminal output to a file ?
For example :
command "fuser" returns the "process-id" and prints the output on the terminal, but I want that output to a file as well. How can I do that ?
/clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor $ fuser -uf... (2 Replies)
Discussion started by: varungupta
2 Replies
4. UNIX Desktop Questions & Answers
I would like to use a terminal session to ssh to switches and routers. I need to capture data while logged into switches to a file I can email for troubleshooting.
I use termial to log into Cisco switch, run the sh tech command, and then sent the output to cisco. Is there a way to run a... (4 Replies)
Discussion started by: tdelliott
4 Replies
5. UNIX for Dummies Questions & Answers
I want to have a terminal open and have something like a "repeating cat" command running in it for a certain text file (in particular /var/log/system.log). So my terminal will scan or cat the text file every so often or whenever the text file system.log gets written to by the system, it will... (1 Reply)
Discussion started by: guitarscn
1 Replies
6. Shell Programming and Scripting
(/home/user1)-> more script.sh
#!/bin/ksh
( echo open devicename
sleep 3;
echo user;
sleep 2;
echo password;
sleep 2;
echo "/info/dump"; ---------> This needs to redirect to a file .Can be number of pages
sleep 2;
echo "exit" ) | telnet
Please use code tags next time for... (2 Replies)
Discussion started by: necro98
2 Replies
7. UNIX for Dummies Questions & Answers
Hi all !
I noticed something very weird.
I have a large pipe delimited file (20 fields/3,000 records) that looks like that:
AAA|BBB|11111|22222|...|($NF of record 1)
CCC|DDD|33333|44444|...|($NF of record 2)
CCC|DDD|55555|66666|...|($NF of record 3)
For the lines with same 1st and 2nd... (3 Replies)
Discussion started by: beca123456
3 Replies
8. Shell Programming and Scripting
I am having a bash script which is basically invoking a python program to validate the Source Query results against the target query results. I am placing all the queries in a .sql file.
I want to write to a Error log file incase if the syntax is wrong or if the column is not present in the... (4 Replies)
Discussion started by: ronitreddy
4 Replies
9. Shell Programming and Scripting
Hi,
I have text file with the header like this
tracking_id condition replicate FPKM
XLOC_000001 alpha 1 10.3199
XLOC_000001 alpha 0 10.3686
XLOC_000001 alpha 2 15.5619
...
With the first column being genes, the second being the condition, the third... (5 Replies)
Discussion started by: 4galaxy7
5 Replies
10. Shell Programming and Scripting
I have been having an extremely annoying problem. For the record, I am relatively new at this. I've only been working with unix-based OS's for roughly two years, mostly Xubuntu and some Kali. I am pretty familiar with the BASH language, as that's the default shell for debian. Now, I've made this... (16 Replies)
Discussion started by: Huitzilopochtli
16 Replies
term::interact::pager(n) Terminal control term::interact::pager(n)
__________________________________________________________________________________________________________________________________________________
NAME
term::interact::pager - Terminal widget, paging
SYNOPSIS
package require Tcl 8.4
package require term::interact::pager ?0.1?
term::interact::pager object text ?options...?
object interact
object done
object clear
object text text
object configure
object configure option
object configure option value...
object cget option
_________________________________________________________________
DESCRIPTION
This package provides a class for the creation of a simple paging text display.
CLASS API
The package exports a single command, the class command, enabling the creation of pager instances. Its API is:
term::interact::pager object text ?options...?
This command creates a new pager object with the name object, initializes it, and returns the fully qualified name of the object
command as its result.
The argument is the text to show, possibly followed by configuration options and their values. The options are explained in the sec-
tion Configuration.
OBJECT API
The objects created by the class command provide the methods listed below:
object interact
Show the pager in the screen at the configured location and start interacting with it. This opens its own event loop for the pro-
cessing of incoming characters. The method returns when the interaction has completed. See section Interaction for a description of
the possible interaction.
object done
This method can be used by user supplied actions to terminate the interaction with the object.
object clear
This method can be used by user supplied actions to remove the pager from the terminal.
object text text
This method can be used to change the text shown by the pager. The pager will reset the dispay to show the first line of the text
at the top.
object configure
object configure option
object configure option value...
object cget option
Standard methods to retrieve and configure the options of the pager.
CONFIGURATION
A pager instance recognizes the following options:
-in chan
Specifies the channel to read character sequences from. Defaults to stdin.
-out chan
Specifies the channel to write the pager contents to. Defaults to stdout.
-column int
Specifies the column of the terminal where the left margin of the pager display should appear. Defaults to 0, i.e. the left-most
column.
-line int
Specifies the line of the terminal where the top margin of the pager display should appear. Defaults to 0, i.e. the top-most line.
-height int
Specifies the number of lines of text to show at most in the display. Defaults to 25.
-actions dict
Specifies a dictionary containing additional actions, using character sequences as keys. Note that these sequences cannot override
the hardwired sequences described in section Interaction.
INTERACTION
A pager object recognizes the control sequences listed below and acts as described. The user can supply more control sequences to act on
via the configuration, but is not able to overide these defaults.
Cursor Up
The text is scrolled down a single line, making one more line visible at the top. The pager will not react if the first line of the
text is already shown.
Cursor Down
The text is scrolled up a single line, making one more line visible at the bottom. The pager will not react if the last line of the
text is already shown.
Page Up
The text is scrolled down a page. The pager will not react if the first line of the text is already shown.
Page Down
The text is scrolled up a page. The pager will not react if the last line of the text is already shown.
Enter/Return
The interaction with the object is terminated.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category term of
the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
KEYWORDS
control, pager, terminal, text display
COPYRIGHT
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
term 0.1 term::interact::pager(n)