[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

script to label out put of command

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.


Ex:

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
    3238
    3647
     409


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


Thanks,
0
bt707
Asked:
bt707
1 Solution
 
TintinCommented:
No need for Perl.

#!/bin/sh
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`
0
 
bt707Author Commented:
Thanks Tintin, that worked great!!

Thanks again
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now