Sponsored Content
Full Discussion: Word Count In A Script
Top Forums Shell Programming and Scripting Word Count In A Script Post 302711293 by domdom110 on Friday 5th of October 2012 05:55:45 PM
Old 10-05-2012
Word Count In A Script

I am in need of a basic format to
1. list all files in a directory
2. list the # of lines in each file
3. list the # of words in each file

If someone could give me a basic format i would appreicate it
***ALSO i can not use the FIND command***
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

count word

hi, given a file i need to get the first line and secodn line and count each of the line whether the length of first line and second line is the same i don;t know how to get the length of the line...seems like use 'wc' cannot do it... please advice (1 Reply)
Discussion started by: ariuscy
1 Replies

2. UNIX for Dummies Questions & Answers

script to count a word in a flie

hi All, I have one question to have a answer with your help. i need to have a script for searching a file with .log extension form all directories. search for a word " Pass" in the files and to count the occurence of the word "Pass". i need all your help to solve the problem. Thanks,... (3 Replies)
Discussion started by: sipmohan
3 Replies

3. Shell Programming and Scripting

specified word count

hi iam trying to do a specified word count on file called text i have a few ideas but don't get the result i want do any one have a idea please help i have this at the moment cat text echo "Please enter the word you are looking for:" read string echo "the word < $string > occurs in... (5 Replies)
Discussion started by: bhaviknp
5 Replies

4. Shell Programming and Scripting

scripting - write a script that will count the number of times a particular word

hello everyone, I'm trying to learn some scripts but i cant get my head around two of them. 1. how can i write a script that will count the number of times a particular word is used in file? 2. how can i make a script that will take me to a web page from unix? if anyone could help it... (3 Replies)
Discussion started by: BigTool4u2
3 Replies

5. Shell Programming and Scripting

Word count of lines ending with certain word

Hi all, I am trying to write a command that can help me count the number of lines in the /etc/passwd file ending in bash. I have read through other threads but am yet to find one indicating how to locate a specifc word at the end of a line. I know i will need to use the wc command but when i... (8 Replies)
Discussion started by: warlock129
8 Replies

6. UNIX for Advanced & Expert Users

Word count

Script that lists all words used in one or more files and displays their count (pattern /\W+/ to split the lines of the input file into words can b used).. It should display list in format word:count...gets Filename as an cmd line argument! eg: $perl test doc (where doc is d file we are going to... (4 Replies)
Discussion started by: aadi_uni
4 Replies

7. Shell Programming and Scripting

Need script to count specific word and iterate over number of files.

Hi Experts, I want to know the count of specific word in a file. I have almost 600+ files. So I want to loop thru each file and get the count of the specific word. Please help me on achieving this... Many thanks (2 Replies)
Discussion started by: elamurugu
2 Replies

8. Shell Programming and Scripting

if, word count

Hi, I need to count the lines of a file stack.html and if the amount lines i want to do something. At this moment, I have if ; then ... This is not working. Any ideas? Thanks! (3 Replies)
Discussion started by: azertyazerty
3 Replies

9. Shell Programming and Scripting

Script to count word occurrences, but exclude some?

I am trying to count the occurrences of ALL words in a file. However, I want to exclude certain words: short words (i.e. <3 chars), and words contained in an blacklist file. There is also a desire to count words that are capitalized (e.g. proper names). I am not 100% sure where the line on... (5 Replies)
Discussion started by: Cronk
5 Replies

10. UNIX for Beginners Questions & Answers

UNIX script to check word count of each word in file

I am trying to figure out to find word count of each word from my file sample file hi how are you hi are you ok sample out put hi 1 how 1 are 1 you 1 hi 1 are 1 you 1 ok 1 wc -l filename is not helping , i think we will have to split the lines and count and then print and also... (4 Replies)
Discussion started by: mirwasim
4 Replies
cracklib-format(8)					      Debian GNU/Linux manual						cracklib-format(8)

NAME
cracklib-format, cracklib-packer, cracklib-unpacker - cracklib dictionary utilities SYNOPSIS
cracklib-format file ... cracklib-packer cracklib_dictpath cracklib-unpacker cracklib_dictpath DESCRIPTION
cracklib-format takes a list of text files each containing a list of words, one per line, It lowercases all words, removes control charac- ters, and sorts the lists. It outputs the cleaned up list to standard output. The text files may be optionally compressed with gzip(1). If you supply massive amounts of text to cracklib-format you must have enough free space available for use by the sort(1) command. If you do not have 20Mb free in /var/tmp (or whatever temporary area your sort(1) command uses), have a look at the /usr/sbin/cracklib-format pro- gram which is a sh(1) program. You can usually tweak the sort(1) command to use any large area of disk you desire, by use of the -T option. cracklib-format has a hook for this. cracklib-packer reads from standard input a list of sorted and cleaned words and creates a database in the directory and prefix given by the command line argument cracklib_dictpath. Three files are created with the suffixes of .hwm, .pwd, and .pwi. These three files are in the format that the FascistCheck(3) subroutine, cracklib-unpacker(8), and cracklib-check(8), utilities understand. The number of words read and written are printed on stdout(3). cracklib-unpacker reads from the database in the directory and prefix given by the command line argument cracklib_dictpath and outputs on standard output the list of words that make up the database. The database is in a binary format generated by the utilities cracklib-format(8) and cracklib-packer(8). On a Debian system the database is located in the directory /var/cache/cracklib/cracklib_dict and is generated daily with the program /etc/cron.daily/cracklib. The loca- tion is also defined in the header file crack.h using the constant CRACKLIB_DICTPATH though none of the subroutines in the cracklib libraries have this location hardcoded into their implementations. FILES
/var/cache/cracklib/cracklib_dict.[hwm|pwd|pwi] cracklib dictionary database files used by utilities. /etc/cron.daily/cracklib cracklib daily cron program to rebuild the cracklib dictionary database. /etc/cracklib/cracklib.conf cracklib configuration file used by the cracklib daily cron program to rebuild the cracklib dictionary database. /usr/include/crack.h cracklib header file defining the subroutine FascistCheck(3) and the constant CRACKLIB_DICTPATH used to compile in the location of the cracklib dictionary database for these utilities. /usr/sbin/cracklib-format cracklib shell script to create initial list of words for dictionary database. SEE ALSO
FascistCheck(3), cracklib-check(8), update-cracklib(8), create-cracklib-dict(8) /usr/share/doc/libcrack2/libcrack2.html /usr/share/doc/cracklib-runtime/cracklib-runtime.html AUTHOR
cracklib2 is written by Alec Muffett <alecm@crypto.dircon.co.uk>. Manual added by Jean Pierre LeJacq <jplejacq@quoininc.com>. 2.7-8.5 Sat Jun 21 22:43:12 CEST 2008 cracklib-format(8)
All times are GMT -4. The time now is 02:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy