09-10-2007
counting words then amending to a file
i want to count the number of words in a file and then redirect this to a file
echo 'total number of words=' wc -users>file
THis isnt working, anyone any ideas.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to figure out a way to count the number of words in the follwing file:
cal 2002 > file1
Is there anyway to do this without using wc but instead using the cut command? (1 Reply)
Discussion started by: r0mulus
1 Replies
2. UNIX for Dummies Questions & Answers
if i have a long list of data, with every line beginning with an ip-address, like this:
62.165.8.187 - - "GET /bestandnaam.html HTTP/1.1" 200 5848 "http://www.domeinnaam.nl/bestandnaam.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
how do i count which ip-adresses are mentioned... (3 Replies)
Discussion started by: FOBoy
3 Replies
3. Shell Programming and Scripting
Hi
Is there a way to count the no. of words in all files in directory. All are text files.I use wc -w but somehow i am not getting the rite answer.
Is there an alternative.
Thanks in advance (9 Replies)
Discussion started by: kinny
9 Replies
4. Programming
Please find the below program. It contains the purpose of the program itself.
/* Program : Write a program to count the number of words in a given text file */
/* Date : 12-June-2010 */
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
int main( int argc, char *argv )
{... (6 Replies)
Discussion started by: ramkrix
6 Replies
5. Shell Programming and Scripting
Hi Pls help in solving my doubt.Iam having file like below
file1.txt
priya
jenny
jenny
priya
raj
radhika
priya
bharti
bharti
Output required:
I need a output like count of repeated words with name for ex:
priya 3
jenny 2 (4 Replies)
Discussion started by: bha148
4 Replies
6. Shell Programming and Scripting
Hi All,
I have written a script on this but it does not do the requisite job. My requirement is this:
1. I have two kinds of files each with different extensions. One set of files are *.dat (6000 unique DAT files all in one directory) and another set *.dic files (6000 unique DIC files in... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies
7. Shell Programming and Scripting
Hi All,
I have written a script on this but it does not do the requisite job. My requirement is this:
1. I have two kinds of files each with different extensions. One set of files are *.dat (6000 unique DAT files all in one directory) and another set *.dic files (6000 unique DIC files in all... (5 Replies)
Discussion started by: shoaibjameel123
5 Replies
8. Shell Programming and Scripting
how to use perl to count number of lines, words characters in a file. (3 Replies)
Discussion started by: winter9
3 Replies
9. Shell Programming and Scripting
Hi, Given below is the input file:
http://i53.tinypic.com/2vmvzb8.png
Given below is what the output file should look like:
http://i53.tinypic.com/1e6lfq.png
I know how to count the occurrence of 1 word from a file, but not all of them. Can someone help please? An explanation on the... (1 Reply)
Discussion started by: r4v3n
1 Replies
10. Shell Programming and Scripting
Hi,
I need a shell script which can provide details from error logs like this
Aug 23 21:19:41 red mountd: authenticated mount request from bl0110.bang.m
pc.local:651 for /disk1/jobs (/disk1)
Aug 23 08:49:52 red dhcpd: DHCPDISCOVER from 00:25:90:2b:cd:7c via eth0: unknown client
Aug 24... (2 Replies)
Discussion started by: ratheeshp
2 Replies
otp(n) RFC 2289 A One-Time Password System otp(n)
__________________________________________________________________________________________________________________________________________________
NAME
otp - One-Time Passwords
SYNOPSIS
package require Tcl 8.2
package require otp ?1.0.0?
::otp::otp-md4 ?-hex? ?-words? -seed seed -count count data
::otp::otp-md5 ?-hex? ?-words? -seed seed -count count data
::otp::otp-sha1 ?-hex? ?-words? -seed seed -count count data
::otp::otp-rmd160 ?-hex? ?-words? -seed seed -count count data
_________________________________________________________________
DESCRIPTION
This package is an implementation in Tcl of the One-Time Password system as described in RFC 2289 (1). This system uses message-digest
algorithms to sequentially hash a passphrase to create single-use passwords. The resulting data is then provided to the user as either
hexadecimal digits or encoded using a dictionary of 2048 words. This system is used by OpenBSD for secure login and can be used as a SASL
mechanism for authenticating users.
In this implementation we provide support for four algorithms that are included in the tcllib distribution: MD5 (2), MD4 (3), RIPE-MD160
(4) and SHA-1 (5).
COMMANDS
::otp::otp-md4 ?-hex? ?-words? -seed seed -count count data
::otp::otp-md5 ?-hex? ?-words? -seed seed -count count data
::otp::otp-sha1 ?-hex? ?-words? -seed seed -count count data
::otp::otp-rmd160 ?-hex? ?-words? -seed seed -count count data
EXAMPLES
% otp::otp-md5 -count 99 -seed host67821 "My Secret Pass Phrase"
(binary gibberish)
% otp::otp-md5 -words -count 99 -seed host67821 "My Secret Pass Phrase"
SOON ARAB BURG LIMB FILE WAD
% otp::otp-md5 -hex -count 99 -seed host67821 "My Secret Pass Phrase"
e249b58257c80087
REFERENCES
[1] Haller, N. et al., "A One-Time Password System", RFC 2289, February 1998. http://www.rfc-editor.org/rfc/rfc2289.txt
[2] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, MIT and RSA Data Security, Inc, April 1992. (http://www.rfc-edi-
tor.org/rfc/rfc1321.txt)
[3] Rivest, R., "The MD4 Message Digest Algorithm", RFC 1320, MIT, April 1992. (http://www.rfc-editor.org/rfc/rfc1320.txt)
[4] H. Dobbertin, A. Bosselaers, B. Preneel, "RIPEMD-160, a strengthened version of RIPEMD" http://www.esat.kuleuven.ac.be/~cosi-
cart/pdf/AB-9601/AB-9601.pdf
[5] "Secure Hash Standard", National Institute of Standards and Technology, U.S. Department Of Commerce, April 1995.
(http://www.itl.nist.gov/fipspubs/fip180-1.htm)
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category otp of
the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
SEE ALSO
SASL, md4, md5, ripemd160, sha1
KEYWORDS
hashing, message-digest, password, rfc 2289, security
COPYRIGHT
Copyright (c) 2006, Pat Thoyts <patthoyts@users.sourceforge.net>
otp 1.0.0 otp(n)