Operating System - HP-UX
1753773 Members
6268 Online
108799 Solutions
New Discussion юеВ

Re: How do I insert a "hit any key" "pause" into my script?

 
SOLVED
Go to solution
Chris Elmore
Frequent Advisor

How do I insert a "hit any key" "pause" into my script?

Aloha Folks,

Limited by my work-imposed "jack of all trades" SA lifestyle, hence I am a novice at shell scripting and I am preparing a very simple script to help me document my server system for future trouble-shooting purposes. I want to insert an old DOS pause equivalent command that waits for user input after the echoed info via the "hit any key" method. I would also like a nifty way to show our server operators that the script is actually running, some kind of way to show them that these text files/reports are being made, eye candy is great if you know of a way. Thanks in advance folks for anything that you can contribute, I greatly appreciate it.

Very Respectfully,
Chris Elmore

echo **************************************************************************
echo * HP_info_rpt.sh | Ver. 1.0 *
echo * Author: Chris Elmore, Sr. Systems Analyst *
echo * Date Written/Revised: April 14, 2005 *
echo * *
echo * This shell script will generate 9 text file reports to help document *
echo * the HP server system. It will collect these 9 text reports in the *
echo * /export/chris directory. This shell script will be run once per week *
echo * and before & after each release is installed on the HP for our own *
echo * internal documentation and to aid in system troubleshooting. *
echo * *
echo * Revision History: *
echo * 04/14/2005 Ver. 1.0 Written by Chris Elmore. *
echo **************************************************************************

pause
cd /
clear

# Section 1
# To see the disks on the system. This only gives us the physical addresses.
clear
/usr/sbin/ioscan -funC disk > /export/chris/ioscan.txt


# Section 2
# To see the volume groups.
clear
vgdisplay -v > /export/chris/vgdisplay.txt


# Section 3
# To view detailed logical volume information. Look for mirrored and current status.
clear
lvdisplay -v /dev/vg00/lvol* > /export/chris/lvdisplay.txt


# Section 4
# To have a record of the logical volumes.
clear
ll /dev/vg* > /export/chris/ll.txt


# Section 5
# To view the file systems and free space.
clear
bdf > /export/chris/bdf.txt


# Section 6
# To view swap devices.
clear
swapinfo > /export/chris/swapinfo.txt


# Section 7
# To look at the boot information.
clear
lvlnboot -v /dev/vg00 > /export/chris/lvlnboot.txt


# Section 8
# To look at the boot area.
clear
lifls -Clv /dev/dsk/c1t2d0 > /export/chris/lifls.txt


# Section 9
# To get a detailed directory and file listing showing permissions, owner & group info, in a recursive listing.
clear
cd /
ls -alFR > /export/chris/permissions.txt

"Life is love and love is life"
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: How do I insert a "hit any key" "pause" into my script?

echo "Press to continue \c"
read DUMMY
If it ain't broke, I can fix that.
Chris Elmore
Frequent Advisor

Re: How do I insert a "hit any key" "pause" into my script?

Aloha Mr. Stephenson,

I've inserted your two lines in place of the "pause" in my script and it worked flawlessly, but I realize now that my original script is generating garbled output to the terminal screen. I know that it wasn't your two lines, but is there something I am missing in my echo syntax? I am running HP-UX 11.0. I'm assigning you the full 10 pts. for your quick answer though, and thanks.

Very Respectfully,
Chris Elmore
"Life is love and love is life"
A. Clay Stephenson
Acclaimed Contributor

Re: How do I insert a "hit any key" "pause" into my script?

Your problem is
echo **

That is VERY different from echo "**". I leave it as a student exercise to figure out why.
If it ain't broke, I can fix that.
Chris Elmore
Frequent Advisor

Re: How do I insert a "hit any key" "pause" into my script?

AHA! And the light bulb fires! Truly, you are worthy of your HP wreath. Thanks for the help, another 10 pts. and my honest gratitude is your reward well deserved.

Very Respectfully,
Chris Elmore
"Life is love and love is life"
Chris Elmore
Frequent Advisor

Re: How do I insert a "hit any key" "pause" into my script?

Thanks for making me a believer of the HP forums.

Chris
"Life is love and love is life"