- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: 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
Forums
Discussions
Discussions
Discussions
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
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
02-27-2009 06:04 AM
02-27-2009 06:04 AM
sed: Function s/ * cannot be parsed.
sed: Function s/ cannot be parsed.
/usr/local/bin/filesystemcheck.sh[66]: emailfile: not found.
"emailfile" [New file]
*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:
/usr/local/bin/filesystemcheck.sh
Can any of you give me an idea of what is wrong? It runs smoothly on all of my other servers, and all of my server are the same software. HP-UX 11.11 all gold packs applied.
Solved! Go to Solution.
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:09 AM
02-27-2009 06:09 AM
Re: Script error.
#!/usr/bin/sh -x
Then run it again, capture the output and attach it here.
The '-x' turns on 'debug mode' for the shell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:13 AM
02-27-2009 06:13 AM
Re: Script error.
I see two things based on your attachment.
1. Always begin your script's with a shebang line:
#!/usr/bin/sh
...or whatever interpreter is appropriate.
2. You are missing a 'done' as the last line to match the 'do' loop.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:15 AM
02-27-2009 06:15 AM
Solutionexceeded=`bdf | sed '/^Filesystem/d' | head -$count | tail -1 | sed 's/ *
/:/g' | cut -d ":" -f5`
Try to move it to 1 line:
exceeded=`bdf | sed '/^Filesystem/d' |head -$count | tail -1 | sed 's/ * /:/g' | cut -d ":" -f5`
Check all lines for such errors.
regards,
ivan
- Tags:
- bdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:22 AM
02-27-2009 06:22 AM
Re: Script error.
Missing a done? If I was missing a done, the script wouldn't work on my other servers. Right?
Crap there is a LB on those lines. I am retarded I swear! BRB fellas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:26 AM
02-27-2009 06:26 AM
Re: Script error.
- Tags:
- missing attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:27 AM
02-27-2009 06:27 AM
Re: Script error.
Ivan spotted a very big problem unless it is only a manifestion of posting your script here. That is, you can't split commands across lines. You don't need to confine your line length to a terminal line width although this makes readability, printing and editting easier.
If you want to "split" lines, use the line continuation character. For example at the line 42 Ivan cited, you could break the line into three lines like:
exceeded=`bdf | sed '/^Filesystem/d' | \
head -$count | tail -1 | \
sed 's/ */:/g' | cut -d ":" -f5`
...NOTICE that there are no trailing spaces after the continuation character (\) either.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:39 AM
02-27-2009 06:39 AM
Re: Script error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:40 AM
02-27-2009 06:40 AM
Re: Script error.
James/Ivan/Patrick, Always a pleasure and you all always know what needs done. One day I will ahve this scripting thing down.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:41 AM
02-27-2009 06:41 AM
Re: Script error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:42 AM
02-27-2009 06:42 AM
Re: Script error.
> It runs smoothly on all of my other servers...
Why not do (and compare) a simple 'cksum' of the script from the server that doesn't work and any one of the ones that do work? The better be the same. For that matter, re-copy (FTP, scp, etc.) a working copy to the non-working server.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:43 AM
02-27-2009 06:43 AM
Re: Script error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 06:44 AM
02-27-2009 06:44 AM
Re: Script error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 02:03 PM
02-27-2009 02:03 PM
Re: Script error.
exceeded=`bdf | sed '/^Filesystem/d' | \
head -$count | tail -1 | \
sed 's/ */:/g' | cut -d ":" -f5`
Actually you shouldn't need a backslash after the pipe.
In the original source, all archaic `` should be replaced by $().
Also you can replace the two piped seds by:
sed '/^Filesystem/d' | sed 's/ */:/g'
sed -e '/^Filesystem/d' -e 's/ */:/g'
This is highly inefficient:
# This while loop will check the usage of each line of bdf.
# If the %used field exceeds 95%, an e-mail will be sent to me.
You are doing multiple bdfs each time through the loop. Instead put the bdf output in a file and then read that file in the loop.
And then there is a second loop. The data from the first loop could be processed to provide both outputs. Or read that file.
- Tags:
- command substitution