Sponsored Content
Top Forums Shell Programming and Scripting [FUN] Get some stats of your project/s Post 302943271 by Chubler_XL on Thursday 7th of May 2015 02:33:47 AM
Old 05-07-2015
You could replace your Lines section with the below for more speed:

Code:
# Lines
vals=( $( awk -v q="^#,.*,^[[:space:]]*$" '
       BEGIN{cc=split(q,crit,",")}
       { for(i in crit) t[i]+=($0 ~ crit[i]) }
       END { for(i=1; i<=cc;i++) printf "%d ",t[i] }' \
       $(find . -type f -name "st*") )
)
((COMMENTS=vals[0]))
((LINES=vals[1]))
((BLANKS=vals[2]))

This User Gave Thanks to Chubler_XL For This Post:
 

6 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Fun with FreeBSD

Fun With Automounting on FreeBSD Link: Nice tips for FreeBSD Unix. http://ezine.daemonnews.org/200202/automounting.html (2 Replies)
Discussion started by: killerserv
2 Replies

2. Solaris

SSH doesn't pick up user's project from /etc/project

We have a system running ssh. When a user logs in, they do not get the project they are assigned to (they run under "system"). I verify the project using the command "ps -e -o user,pid,ppid,args,project". If you do a "su - username", the user does get the project they are assigned to (and all... (2 Replies)
Discussion started by: kurgan
2 Replies

3. What is on Your Mind?

fun scripts

Lets get a list of everyones funny scripts (8 Replies)
Discussion started by: JamieMurry
8 Replies

4. Solaris

what is the use of /etc/project file and project administration commands?

i have two doubts.. 1. what is the use /etc/project file. i renamed this file and when i tried to switch user or login with some user account the login was happening slowly. but when i renamed it to original name it was working fine... why so? 2. unix already has useradd and grouadd for... (4 Replies)
Discussion started by: chidori
4 Replies

5. News, Links, Events and Announcements

A new project was posted on The UNIX and Linux Forums project board.

A new project was posted on your project board. Project title: Bash Shell Tutoring Estimated Budget: $50/hr Start date: Immediately Required skills: Linux, Bash, Shell, UNIX I work as a datawarehouse designer and developer. Although I usually stick to the role of an analyst,... (0 Replies)
Discussion started by: Neo
0 Replies

6. Shell Programming and Scripting

FINDING DUPLICATE PROJECT ( directory project )

I have a project tree like that. after running find command with the -no -empty option, i am able to have a list of non empty directory DO_MY_SEARCH="find . -type d -not -empty -print0" MY_EXCLUDE_DIR1=" -e NOT_IN_USE -e RTMAP -e NOT_USEFULL " echo " " > $MY_TEMP_RESULT_1 while... (2 Replies)
Discussion started by: jcdole
2 Replies
INNWATCH(8)						      System Manager's Manual						       INNWATCH(8)

NAME
innwatch - monitor innd. SYNOPSIS
innwatch [ -l logfile ] [ -t seconds ] DESCRIPTION
Innwatch is normally started by rc.news. It periodically -- every <innwatchsleeptime in inn.conf> seconds -- examines the load average, and the number of free blocks and inodes on the spool partition, as described by its control file, innwatch.ctl. If the load gets too high, or the disk gets too full, it throttles the server. When the condition restores, it unblocks the server. In addition, on each pass through the loop it will check the logfile <pathlog in inn.conf>/news.crit to see if it has been modified, and send mail to the news administrator if so. Upon receipt of an interrupt signal (SIGINT), innwatch will report its status in the file <pathrun in inn.conf>/innwatch.status. OPTIONS
-l logfile To specify a log file to watch, other than the default of news.crit, use the ``-l'' flag. -t seconds To change the period between checks from the default from inn.conf , use the ``-t'' flag. HISTORY
Written by Mike Cooper <mcooper@usc.edu>, with modifications by <kre@munnari.oz.au>, Steve Groom <stevo@elroy.Jpl.Nasa.Gov> and Christophe Wolfhugel <wolf@pasteur.fr>. This is revision 5909, dated 2002-12-03. SEE ALSO
ctlinnd(8), inn.conf(5), innwatch.ctl(5), shlock(1). INNWATCH(8)
All times are GMT -4. The time now is 09:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy