- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script help urgent
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2001 06:10 PM
тАО06-26-2001 06:10 PM
script help urgent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2001 06:34 PM
тАО06-26-2001 06:34 PM
Re: script help urgent
To get the output of multiple commands into one output file, you just need to specify the redirection to append to the file. Try something like this:
dmesg >file.txt
ioscan -fn >>file.txt
bdf >>file.txt
The first redirection just uses one greater than symbol '>' which will create the file and send standard output to it. The next two redirections use two greater than symbols '>>' which append to the file. If you want to keep writing information to the same file without clearing it at the start you can make the first command use '>>' also.
I hope this helps you. If not, post another question and we'll try something else.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2001 06:36 PM
тАО06-26-2001 06:36 PM
Re: script help urgent
#!/usr/bin/sh
SYSTEM=`hostname`
STALE=`vgdisplay -v | grep stale | wc -l`
print "$SYSTEM"
print `date`
if [ $STALE = 0 ];then
echo "No Stale Mirrors on $SYSTEM"
else
echo "The Following Mirrors are Stale on $SYSTEM: "
vgdisplay -v | egrep -e "LV Name" -e "stale"
fi
echo ""
UNAVAIL=`vgdisplay -v | grep unavail | wc -l`
if [ $UNAVAIL = 0 ];then
echo "No Unavailable Drives on $SYSTEM"
else
echo "The Following Drives are Unavailable on $SYSTEM: "
vgdisplay -v | egrep -e "Name" -e "unavail"
fi
echo ""
echo "Uptime Output"
uptime
echo ""
echo "Who -br Output"
who -br
echo ""
echo "Output of bdf -l"
bdf -l
echo ""
echo "Last 10 Lines of Dmesg"
echo ""
dmesg | tail -10
echo ""
echo "Last 25 Lines of /var/adm/syslog/syslog.log"
echo ""
tail -25 /var/adm/syslog/syslog.log
echo ""
echo "Ioscan Output"
ioscan -kf
When you run it you can pipe it to a file or e-mail it to yourself etc. I hope this helps.
Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2001 06:40 PM
тАО06-26-2001 06:40 PM
Re: script help urgent
If you wish to run something simple you
just use the script program:
# script /tmp/output
# dmesg
# ioscan -fn
# bdf
# vgdisplay -v
etc etc...
The output of all of these will go to
/tmp/output
To finish use Cntl D
HTH
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2001 11:28 PM
тАО06-26-2001 11:28 PM
Re: script help urgent
you can redirect all output within a script when adding a line such as:
exec >file.log
at the top of the script. All following command will put their output to the file.log
Using
exec >file.log 2>&1
will also redirect standard error of all following commands to the file.
Regards