Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solaris bash script using grep giving error

Status
Not open for further replies.
Aug 14, 2008
38
US
Trying to run the following one liner in a bash script to check our mailq for big users. But I receive the error below when trying to run from a script instead of command line. Command line it works great. Anybody have a solution or alternative?

#!/usr/bin/bash
mailq|grep ^[A-F0-9]|cut -c 42-80|sort |uniq -c|sort -n|tail > /tmp/qResults


result:

checkQueue.sh: [A-F0-9]: not found
Usage: grep -hblcnsviw pattern file . . .
.#
 
mailq|grep [!]'[/!]^[A-F0-9][!]'[/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hmmm...interesting. That did the trick for me, Thank you PHV. Figured it would be something simple that I was missing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top