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
AUTHCONFIG(8)						      System Manager's Manual						     AUTHCONFIG(8)

NAME
authconfig, authconfig-tui - an interface for configuring system authentication resources SYNOPSIS
authconfig [options] {--update|--updateall|--test|--probe|--restorebackup <name>|--savebackup <name>|--restorelastbackup} DESCRIPTION
authconfig provides a simple method of configuring /etc/sysconfig/network to handle NIS, as well as /etc/passwd and /etc/shadow, the files used for shadow password support. Basic LDAP, Kerberos 5, and Winbind client configuration is also provided. If --test action is specified, the authconfig just reads the current settings from the various configuration files and prints their values. If --update action is specified, authconfig must be run by root (or through console helper), and configuration changes are saved. Only the files affected by the configuration changes are overwritten. If --updateall action is specified, authconfig must be run by root (or through console helper), and all configuration files are written. The --probe action instructs authconfig to use DNS and other means to guess at configuration information for the current host, print its guesses if it finds them, to standard output, and exit. The --restorebackup, --savebackup, and --restorelastbackup actions provide a possibility to save and later restore a backup of configura- tion files which authconfig modifies. Authconfig also saves an automatic backup of configuration files before every configuration change. This special backup can be restored by the --restorelastbackup action. If --nostart is specified (which is what the install program does), ypbind or other daemons will not be started or stopped immediately fol- lowing program execution, but only enabled to start or stop at boot time. The --enablenis, --enableldap, --enablewinbind, and --enablehesiod options are used to configure user information services in /etc/nss- witch.conf, the --enablecache option is used to configure naming services caching, and the --enableshadow, --enableldapauth, --enablekrb5, and --enablewinbindauth options are used to configure authentication functions via /etc/pam.d/system-auth. Each --enable has a matching --disable option that disables the service if it is already enabled. The respective services have parameters which configure their server names etc. The algorithm used for storing new password hashes can be specified by the --passalgo option which takes one of the following possible val- ues as a parameter: descrypt, bigcrypt, md5, sha256, and sha512. The --enablelocauthorize option allows to bypass checking network authentication services for authorization and the --enablesysnetauth allows authentication of system accounts (with uid < 500) by these services. When the configuration settings allow use of SSSD for user information services and authentication, SSSD will be automatically used instead of the legacy services and the SSSD configuration will be set up so there is a default domain populated with the settings required to con- nect the services. The --enablesssd and --enablesssdauth options force adding SSSD to /etc/nsswitch.conf and /etc/pam.d/system-auth, but they do not set up the domain in the SSSD configuration files. The SSSD configuration has to be set up manually. The allowed configuration of services for SSSD are: LDAP for user information (--enableldap) and either LDAP (--enableldapauth), or Kerberos (--enablekrb5) for authentication. In case SSSD does not support some feature of the legacy services that are required for the site configuration, the use of the legacy ser- vices can be forced by setting FORCELEGACY=yes in /etc/sysconfig/authconfig. The list of options mentioned here in the manual page is not exhaustive, please refer to authconfig --help for the complete list of the options. The authconfig-tui supports all options of authconfig but it implies --update as the default action. Its window contains a Cancel button by default. If --back option is specified at run time, a Back button is presented instead. If --kickstart is specified, no interactive screens will be seen. The values the program will use will be those specified by the other options (--passalgo, --enableshadow, etc.). For namelist you may substitute either a single name or a comma-separated list of names. NOTES
The authconfig-tui is deprecated. No new configuration settings will be supported by its text user interface. Use system-config-authentica- tion GUI application or the command line options instead. The /usr/bin/authconfig uses the consolehelper to authenticate as the system user before it starts up. If you want to run it directly with- out the authentication as the system user, run the /usr/sbin/authconfig command. RETURN CODES
authconfig returns 0 on success, 1 on backup operation errors, 2 if not running with sufficient privileges, 3 if unknown password hash algorithm is specified or incorrect values are set for password strength checking (this error is non fatal), 4 if download of CA certifi- cate fails, 5 if writing configuration files fails on --updateall action, 6 if writing fails on --update action, 7 if Winbind or IPA domain join fails. authconfig-tui returns 0 on success, 2 on error, and 1 if the user cancelled the program (by using either the Cancel or Back button). It can also return the same codes as authconfig. FILES
/etc/sysconfig/authconfig Used to track whether or not particular authentication mechanisms are enabled. Currently includes variables named USESHADOW, USEMD5, USEKERBEROS, USELDAPAUTH, USESMBAUTH, USEWINBIND, USEWINBINDAUTH, USEHESIOD, USENIS, USELDAP, and others. /etc/passwd /etc/shadow Used for shadow password support. /etc/yp.conf Configuration file for NIS support. /etc/sysconfig/network Another configuration file for NIS support. /etc/ldap.conf /etc/nss_ldap.conf /etc/pam_ldap.conf /etc/nslcd.conf /etc/openldap/ldap.conf Used to configure nss_ldap, pam_ldap, nslcd, and the OpenLDAP library. Only the files already existing on the system are modified. /etc/krb5.conf Used to configure Kerberos 5. /etc/hesiod.conf Used to configure Hesiod. /etc/samba/smb.conf Used to configure winbind authentication. /etc/nsswitch.conf Used to configure user information services. /etc/login.defs Used to configure parameters of user accounts (minimum UID of a regular user, password hashing algorithm). /etc/pam.d/system-auth Common PAM configuration for system services which include it using the include directive. It is created as symlink and not relinked if it points to another file. /etc/pam.d/system-auth-ac Contains the actual PAM configuration for system services and is the default target of the /etc/pam.d/system-auth symlink. If a local configuration of PAM is created (and symlinked from system-auth file) this file can be included there. SEE ALSO
authconfig-gtk(8), system-auth-ac(5), passwd(5), shadow(5), pwconv(1), domainname(1), ypbind(8), nsswitch.conf(5), smb.conf(5), sssd(8) AUTHORS
Nalin Dahyabhai <nalin@redhat.com>, Preston Brown <pbrown@redhat.com>, Matt Wilson <msw@redhat.com>, Tomas Mraz <tmraz@redhat.com> Red Hat, Inc. 22 July 2011 AUTHCONFIG(8)
All times are GMT -4. The time now is 05:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy