Solved

How to Capture Screens from the Command Line or a Script

Posted on 2002-06-20
16
336 Views
Last Modified: 2013-12-06
Background:
The systems is an HP715 running HP-UX 10.20 with CDE.

Question:
The system has a GUI-based screen capture tool, but I'd like to be able to accomplish the same thing either from the command line or with a script. Is that possible, and if so, how is it done?

Thanks!
0
Comment
Question by:pdouglas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +2
16 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7096383
xgrabsc
0
 
LVL 6

Expert Comment

by:bira
ID: 7096497
capture Command

Purpose

Allows terminal screens to be dumped to a file.

Syntax

capture [ -a ] [ File ]
0
 

Author Comment

by:pdouglas
ID: 7096670
ahoffman,

Is that a shell command?

bira,

The man page on that command has next to nothing in it. What does the a switch do? How do I specify which part of the screen to capture, or better still, which window?

Thanks guys!
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:bira
ID: 7096693
-a      Appends the screen contents to the specified file or, if no file
is specified, to the screen.out file.
0
 
LVL 6

Expert Comment

by:bira
ID: 7096704
To end the capture, use ^P
0
 
LVL 6

Expert Comment

by:bira
ID: 7096738
pdouglas


   capture will get the the full screen, not part of it.
  As i use it in AIX, and the man page is more complete, i
  can post it complete, if you want.
0
 

Author Comment

by:pdouglas
ID: 7096786
bira,

That would be good.

Thanks.
0
 

Author Comment

by:pdouglas
ID: 7096797
bira,

It sounds like this utility is more for running interactively, in which case the GUI is just as good. I need something that can be imbedded into a script.
0
 
LVL 6

Expert Comment

by:bira
ID: 7096986

 Really it will work only interactively, so i think
 it´s not what you are looking for.
 
  Good luck
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7097185
xgrabsc is a command which commes with your X server, usually.
It can grab the entire screen (screen in terms of the X server), a particular window or a rectangle of your choice. You also can specify the output format. It all can be configured with command line options.
It's far toooo much to post it all here, please read the man-page. STFN (search the f... net) for "xgrabsc +AIX" if it is not installed on your system, there are numerous sides where you can get it as source or precompiled binary.
0
 
LVL 11

Accepted Solution

by:
griessh earned 200 total points
ID: 7097312
You might also look at the xwd command. We run it for our screen snapshots:

xwd -root > <name>.xwd

if you need another format you can always:

convert <name>.xwd <name>.<extension>

BTW: 'convert' is a tool that comes with ImageMagick

======
Werner
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7097646
Hi ahoffmann,

   Could you please tell me where can I get a copy of xgrabsc for Solaris (Sparc & Intel) binary or source will
be fine.  Thanks.

   pdouglas, sorry about the interrupt, BTY, I use xv for screen capture.
   
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7098315
http://www.sunfreeware.com/
xv is not bad, but has not as much options as xgrabsc
I love these roughly 15 year old programs, still working ;-)
0
 

Author Comment

by:pdouglas
ID: 7098398
I'd like to thank everyone who responded. Thank you for taking the time to try and help. You guys are top notch.

griessh,

Your suggestion is just what I need. I *really* appreciate it!

pdouglas
0
 
LVL 11

Expert Comment

by:griessh
ID: 7098487
You're welcome. It seems we had the same problem ... In my case it's the documentation department who needs screen snapshots of our product. Since they need to capture menues also, they rlogin from another system and do the capture ...

======
Werner
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7098756
Thanks for the  good infor, I use xv more than 10 years, it is time to learn something new.

Regards
   yuzh
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question