Operating System - HP-UX
1833006 Members
3339 Online
110048 Solutions
New Discussion

how to catch all input and output of running a script.

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

how to catch all input and output of running a script.

Hi,

I need to run configure script, which needs a lot of inputs and also produces a lot of output.

How do I catch these inputs and outputs to a file?

Thanks,
none
2 REPLIES 2
Rodney Hills
Honored Contributor

Re: how to catch all input and output of running a script.

Enter "script filename". This will capture input/output to "filename".

HTH

-- Rod Hills
There be dragons...
Sridhar Bhaskarla
Honored Contributor
Solution

Re: how to catch all input and output of running a script.

Hi,

Is this related to the other question you posted on installing sw packages?.

If so, capturing inputs can be tricky. I convert all my interactive installation scripts to non-interactive by either first installing the software on one system and then make a package or modify the script to source in an input file. For ex., one of the install scripts for a software has the following

printf "Enter your model:"
read MODEL
if [ $MODEL -eq bla bla ]
etc.,
...

What I would do is the following.

. myconfigfile
..
..
if [ $MODEL -eq bla bla ]
etc.,
..

myconfigfile is like this

MODEL=$(model)
HOST=$(hostname)
etc

Otherway is to place request scripts. Look at Request Scripts. Look at the following SD documentation.

http://docs.hp.com/hpux/onlinedocs/B2355-90789/B2355-90789.html

Output of the config file goes into sw*.log files. You will need suppress the output within the script as far as I know.


-Sri
You may be disappointed if you fail, but you are doomed if you don't try