Sponsored Content
Full Discussion: Word Count
Top Forums UNIX for Dummies Questions & Answers Word Count Post 302312188 by quirkasaurus on Thursday 30th of April 2009 02:52:14 PM
Old 04-30-2009
not possible as stated, chowhan.
but read my first reply for the easy answer.
 

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. 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

3. Fedora

word count wc

could someone explain this please. echo aaaa|wc -c 5 echo aaaa|wc -m 5 But I'd expect the count to be 4 Its SunOS 5.8 Thanks in Advance. (5 Replies)
Discussion started by: chaandana
5 Replies

4. Shell Programming and Scripting

how to count a word in a file

dear all, i have a requirement to count the errors and display from a file. eg. file1.txt sjdgfjdgfgd ora-0001 sdjgfydh sdukgh7 23 sjdgfjdgfgd ora-0002 sdjgfydhsf34 ew 34v sjdgfjdgfgd ora-0008 sdjgfydh asdf asdfas sjdgfjdgfgd ora-0001 sdjgfydhjkbs ui873 sjdgfjdgfgd ora-0004 sdjgfydh... (9 Replies)
Discussion started by: unx100
9 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

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

8. Shell Programming and Scripting

Line and word count.

Im trying to make a bash file that will take another file and count how many lines there are and then count how many words are in each line. Any help would be great. (15 Replies)
Discussion started by: syco__
15 Replies

9. UNIX for Dummies Questions & Answers

word count with grep

Hi, It is very interesting to learn the unix, i just struck with a doubt like i have below content in my file xyz xyz xyz xyz i just want know the word count by using grep -wc 'xyz' <filename>, but it is giving 3 instead of 4.So i understood that it is showing matched line numbers count... (2 Replies)
Discussion started by: vmachava
2 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
res_search(3)						     Library Functions Manual						     res_search(3)

NAME
res_search, res_query - Queries domain server and checks response LIBRARY
Standard C Library (libc.a, libc.so) SYNOPSIS
#include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> int res_search ( const char *domain_name, int class, int type, u_char *answer, int answer_len;) The res_query syntax is as follows: int res_query ( const char *domain_name, int class, int type, u_char *answer, int answer_len;) PARAMETERS
Points to the fully-qualified name of the domain. If the domain_name parameter points to a single label and the RES_DEFNAMES bit is set, as it is by default, the function appends domain_name to the current domain name. The current domain name is defined by the name server in use or in the /etc/resolv.conf file. Specifies one of the following parameters: Specifies the ARPA Internet. Specifies the Chaos network at MIT. Requires one of the following values: Host address Authoritative server Mail destination Mail forwarder Canonical name Start of authority zone Mailbox domain name Mail group member Mail rename name NULL resource record Well known service Domain name pointer Host information Mailbox information Mail routing information User (finger) information User ID Group ID Points to a location of the server's reply. Specifies the length of the answer pointed to by the answer parameter. DESCRIPTION
The res_search() and res_query() functions construct a query, send it to the local server, and await a response. In addition, res_search() implements the default and search rules specified by the RES_DEFNAMES and RES_DNSRCH resolver options. The function returns the first suc- cessful reply. The res_search() and res_query() functions part of a set of subroutines that form the resolver, a set of functions that resolve domain names. Global information that is used by the resolver functions is kept in the _res data structure. The /include/resolv.h file contains the _res data structure definition. RETURN VALUES
Upon successful completion, the res_search() function returns the size of the answer. If the answer is larger than the value of the answer_len parameter, the function fails and returns a value of -1. ERRORS
If an error occurs during a resolver operation, the h_errno external variable is set. Error code values and reasons are defined in <netdb.h>. FILES
Contains the name server and domain name. RELATED INFORMATION
Functions: dn_comp(3), dn_expand(3), dn_find(3), dn_skipname(3), _getlong(3), _getshort(3), putlong(3), putshort(3), res_init(3), res_mkquery(3), res_query(3), res_send(3). delim off res_search(3)
All times are GMT -4. The time now is 10:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy