- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script error
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
тАО10-01-2008 06:58 AM
тАО10-01-2008 06:58 AM
# vi lanaction.sh
"lanaction.sh" [Read only] 29 lines, 385 characters
#!/bin/ksh
#################################
# CURRENTLY IN PROGRESS
#
#
#
#################################
function lanad
{
lanadmin<< EOF >/tmp/t 2>&1
lan
display
quit
EOF
cat /tmp/t|grep Inbound|grep Oct|awk '{print $4}'
}
echo "Inbound Bytes per second on default lan interface"
let z=0
while true
do
sleep 1
let x=$(lanad)
let t=$x-$z
echo $t
let z=$x
done
:q!
# sh lanaction.sh
lanaction.sh[10]: Syntax error at line 12 : `<<' is not matched.
Solved! Go to Solution.
- Tags:
- here doc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 07:11 AM
тАО10-01-2008 07:11 AM
Re: Script error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 07:19 AM
тАО10-01-2008 07:19 AM
Re: Script error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 07:26 AM
тАО10-01-2008 07:26 AM
Re: Script error
Is "EOF" in column 1?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 07:28 AM
тАО10-01-2008 07:28 AM
Re: Script error
you need:
lanadmin <
...your stuff here..
.
EOF
NOTE: <<-EOF can be used if the second EOF is preceded by one (or more???) tabs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 07:31 AM
тАО10-01-2008 07:31 AM
Re: Script error
function lanad
{
echo "lan\ndisplay\n\nquit" | lanadmin 2>&1 | awk '/Inbound Octets/ {print $4}'
}
HTH
Duncan
I am an HPE Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 07:38 AM
тАО10-01-2008 07:38 AM
Re: Script error
HTH
Duncan
I am an HPE Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 07:51 AM
тАО10-01-2008 07:51 AM
Re: Script error
I am still a bit confused as to why the original doesn't work though. The second "EOF" is the first character in that line, so even though yours worked well duncan, I would still like to know where I messed up the first time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 07:53 AM
тАО10-01-2008 07:53 AM
Re: Script error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 09:11 AM
тАО10-01-2008 09:11 AM