script to label out put of command

Posted on 2004-11-28
Last Modified: 2010-03-05
I have a command that I run and it prints out three numbers to the screen after it runs, I need to make a script with these three commands in
it, then take the three numbers and give them a lable and print this to the screen.


Command and the three numbers it prints out to the screen

find /mail/queue/ -type f | egrep -v '\.etc$' | wc -l;find /mail/queue/ -type f | wc -l;find /mail/queue/ -type f -name *.etc | wc -l

What I want to do with these three numbers would be to print this out to the screen using the number it put out.

Queue 1  3238
Queue 2  3647
Queue 3   409

Question by:bt707
    LVL 48

    Accepted Solution

    No need for Perl.

    echo "Queue 1 " `find /mail/queue -type f | grep -vc '.etc$'`
    echo "Queue 2 " `find /mail/queue -type f | wc -l`
    echo "Queue 3 "  `find /mail/queue -type -name -name "*.etc" | wc-l`

    Author Comment

    Thanks Tintin, that worked great!!

    Thanks again

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
    Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now