Sponsored Content
Top Forums Shell Programming and Scripting [FUN] Get some stats of your project/s Post 302943324 by sea on Thursday 7th of May 2015 09:03:05 AM
Old 05-07-2015
Just asking, are you aware that i created this thread with solved status?
Hence the [FUN] tag.

Anyway, for some reason the lines found jumped from 14541 to 22469, probably cause by the fact that the jpg files are still listed.

So to try it:
Code:
for F in $(find . -type d -name ".git" -prune -o -type f \! -name ".jpg" \! -name ".png" -print)
do	echo "$F"
	COMMENTS=$(( $COMMENTS + $(grep ^"#" "$F" | wc -l) ))
	LINES=$(( $LINES + $(cat "$F" | wc -l) ))
	BLANKS=$(( $BLANKS + $(grep ^[[:space:]]$ "$F" | wc -l) ))
	((FILES+=1))
done

Even with escaped "\.jpg" and/or unescaped "!", the screenshots are shown and their lines counted.
Ironicly, it reports only 2 files more... Smilie

Full output:
Code:
time ./stats.sh
########################################
	Project stats for "tui"
########################################
264 kb	in bin
24 kb	in conf.etc
12 kb	in conf.home
32 kb	in docs/samples
176 kb	in docs/wiki
280 kb	in docs
192 kb	in man
1984 kb	in screenshots
12 kb	in templates/manpage
32 kb	in templates/scripts
12 kb	in templates/usr
64 kb	in templates
36 kb	in themes
13 folders with a total of 3120 kbytes
########################################
./install.sh
./conf.etc/apps.conf
./conf.etc/status.conf
./conf.etc/commands.conf
./conf.etc/tui.conf
./conf.etc/colors.conf
./screenshots/examples-interface_ds_make_kickstart.jpg
./screenshots/tui-list.jpg
./screenshots/compare-themes-xterm.jpg
./screenshots/compare-themes-lxterminal.jpg
./screenshots/compare_with_root_mode.jpg
./screenshots/mini-demo-tui.jpg
./screenshots/tui-browser_textmode_root.jpg
./screenshots/tui-psm.jpg
./screenshots/demo_working_with_conf_files.jpg
./screenshots/tui-log.jpg
./screenshots/examlpes_tui-browser.jpg
./screenshots/tui-status.jpg
./screenshots/tui-printf_splitting.jpg
./screenshots/tui-browser_long.jpg
./screenshots/tui-select.jpg
./screenshots/demo-interface.jpg
./screenshots/tui-progress-examples.jpg
./docs/README.md
./docs/CONFIG.md
./docs/samples/demo-compare-with-bash.sh
./docs/samples/sample_tui-conf-get_and_set.sh
./docs/samples/sample_tui-progress.sh
./docs/samples/demo-interface-top-bottom.sh
./docs/samples/demo-interface-select-loop.sh
./docs/samples/sample_tui-status.sh
./docs/samples/sample_tui-log.sh
./docs/LICENSE
./docs/README-new.md
./docs/INSTALL.md
./docs/wiki/tui-conf-set.md
...
./man/tui-log.1
./man/tui-new-browser.1
./man/tui-new-manpage.1
./man/tui-str-usb.1
./man/tui-press.1
./man/tui-read.1
./man/tui-conf-get.1
...
./bin/tui-bol-gui
./bin/tui-install
./bin/tui-str-extension
./bin/tui-str-genfilename
./bin/tui-str-usb
./bin/tui-indi
Spread across 192 files, there are:
Lines Total: 		 22470
Comment lines: 		 2426
Blank lines: 		 206
Avrg lines p. file: 	 117

real	0m0.751s
user	0m0.290s
sys	0m0.848s

Smilie
 

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
IPSEC_TRAP_COUNT(5)						Executable programs					       IPSEC_TRAP_COUNT(5)

NAME
trap_count - KLIPS statistic on number of ACQUIREs SYNOPSIS
cat /proc/net/ipsec/stats/trap_count OBSOLETE
Note that trap_count is only supported on the classic KLIPS stack. It is not supported on any other stack and will be completely removed in future versions. A replacement command still needs to be designed DESCRIPTION
/proc/net/ipsec/stats/trap_count is a read-only file. It contains a hexadecimal number which records the number of attempts to send PF_ACQUIRE messages. Only those recorded by trap_sendcount were actually successfully passed to userland. Note that the userland may still have lost them on its own. FILES
/proc/net/ipsec/stats/trap_sendcount SEE ALSO
ipsec(8), ipsec_pf_key(5), trap_sendcount(5), pluto(8) HISTORY
Written for the Linux FreeS/WAN project <http://www.freeswan.org/> by Michael C. Richardson <mcr@freeswan.org> AUTHOR
Paul Wouters placeholder to suppress warning libreswan 01/10/2014 IPSEC_TRAP_COUNT(5)
All times are GMT -4. The time now is 12:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy