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
Distributions(3pm)					User Contributed Perl Documentation					Distributions(3pm)

NAME
Statistics::Distributions - Perl module for calculating critical values and upper probabilities of common statistical distributions SYNOPSIS
use Statistics::Distributions; $chis=Statistics::Distributions::chisqrdistr (2,.05); print "Chi-squared-crit (2 degrees of freedom, 95th percentile " ."= 0.05 level) = $chis "; $u=Statistics::Distributions::udistr (.05); print "u-crit (95th percentile = 0.05 level) = $u "; $t=Statistics::Distributions::tdistr (1,.005); print "t-crit (1 degree of freedom, 99.5th percentile = 0.005 level) " ."= $t "; $f=Statistics::Distributions::fdistr (1,3,.01); print "F-crit (1 degree of freedom in numerator, 3 degrees of freedom " ."in denominator, 99th percentile = 0.01 level) = $f "; $uprob=Statistics::Distributions::uprob (-0.85); print "upper probability of the u distribution (u = -0.85): Q(u) " ."= 1-G(u) = $uprob "; $chisprob=Statistics::Distributions::chisqrprob (3,6.25); print "upper probability of the chi-square distribution (3 degrees " ."of freedom, chi-squared = 6.25): Q = 1-G = $chisprob "; $tprob=Statistics::Distributions::tprob (3,6.251); print "upper probability of the t distribution (3 degrees of " ."freedom, t = 6.251): Q = 1-G = $tprob "; $fprob=Statistics::Distributions::fprob (3,5,.625); print "upper probability of the F distribution (3 degrees of freedom " ."in numerator, 5 degrees of freedom in denominator, F = 6.25): " ."Q = 1-G = $fprob "; DESCRIPTION
This Perl module calculates percentage points (5 significant digits) of the u (standard normal) distribution, the student's t distribution, the chi-square distribution and the F distribution. It can also calculate the upper probability (5 significant digits) of the u (standard normal), the chi-square, the t and the F distribution. These critical values are needed to perform statistical tests, like the u test, the t test, the F test and the chi-squared test, and to calculate confidence intervals. If you are interested in more precise algorithms you could look at: StatLib: http://lib.stat.cmu.edu/apstat/ ; Applied Statistics Algorithms by Griffiths, P. and Hill, I.D., Ellis Horwood: Chichester(1985) BUGS
This final version 1.02 has been released after more than one year without a bug report on the previous version 0.07. Nevertheless, if you find any bugs or oddities, please do inform the author. INSTALLATION
See perlmodinstall for information and options on installing Perl modules. AVAILABILITY
The latest version of this module is available from the Distribution Perl Archive Network (CPAN). Please visit http://www.cpan.org/ to find a CPAN site near you or see http://www.cpan.org/authors/id/M/MI/MIKEK/ . AUTHOR
Michael Kospach <mike.perl@gmx.at> Nice formating, simplification and bug repair by Matthias Trautner Kromann <mtk@id.cbs.dk> COPYRIGHT
Copyright 2003 Michael Kospach. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Statistics::ChiSquare, Statistics::Table::t, Statistics::Table::F, perl(1). perl v5.12.4 2003-10-01 Distributions(3pm)
All times are GMT -4. The time now is 08:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy