1826103 Members
4802 Online
109690 Solutions
New Discussion

Help with script

 
SOLVED
Go to solution
Jason Arrhaman
Occasional Advisor

Help with script

I need help writing a script that will run a series of commands like bdf, lanscan, vgdisplay etc . . and append each of the outputs from these commands to a single text file. Also I would like the script to separate the output from each command by a number of lines and have a header for each output section like: "Disk info" just above the output for BDF etc.


Anyone have any ideas?
4 REPLIES 4
Sachin Patel
Honored Contributor
Solution

Re: Help with script

Jason
The gurus here have idea that you will not even belive it. But I don't

Just start something simple like

#!/bin/sh
echo "disk info" > myoutput
bdf -l >> myoutput
echo "\n\n" >> myoutput
echo "lanscan info" >> myoutput
lanscan >> myoutput

and so on.......


> will create a file myoutput
>> will append to the file

Sachin
Is photography a hobby or another way to spend $
Umapathy S
Honored Contributor

Re: Help with script

hi,

I got this from this forum long back. Not able to recollect the date and thread. But a great script which I am using once in a month to collect statistics. Go through the script and modify for your requirements.
Check the comment section also. I am very grateful to the people who wrote and gave this script.

HTH
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Jason Arrhaman
Occasional Advisor

Re: Help with script

THANKS GUYS SO MUCH!!!!!

VERY HELPFUL. After a few more posts in this forum, I'll be a HPUX GURU too. LOL.
Sachin Patel
Honored Contributor

Re: Help with script

You bet Jason you can, just don't use exit command.

Sachin
Is photography a hobby or another way to spend $