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
Vend::Ship::Postal(3pm) 				User Contributed Perl Documentation				   Vend::Ship::Postal(3pm)

NAME
Vend::Ship::Postal -- Calculate US Postal service international rates SYNOPSIS
(in catalog.cfg) Database usps ship/usps.txt TAB Database air_pp ship/air_pp.txt TAB Database surf_pp ship/surf_pp.txt TAB (in shipping.asc) air_pp: US Postal Air Parcel crit weight min 0 max 0 cost e No shipping needed! at_least 4 adder 1 aggregate 70 table air_pp min 0 max 1000 cost s Postal min 70 max 9999999 cost e Too heavy for Air Parcel surf_pp: US Postal Surface Parcel crit weight min 0 max 0 cost e No shipping needed! at_least 4 adder 1 aggregate 70 table surf_pp min 0 max 1000 cost s Postal min 70 max 9999999 cost e Too heavy for Postal Parcel DESCRIPTION
Looks up a service zone by country in the "usps" table, then looks in the appropriate rate table for a price by that zone. Can aggregate shipments greater than 70 pounds by assuming you will ship multiple 70-pound packages (plus one package with the remainder). perl v5.14.2 2010-03-25 Vend::Ship::Postal(3pm)
All times are GMT -4. The time now is 04:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy