Sponsored Content
Full Discussion: [Solved] wc behaving weirdly
Top Forums UNIX for Advanced & Expert Users [Solved] wc behaving weirdly Post 302893171 by MadeInGermany on Monday 17th of March 2014 04:37:55 PM
Old 03-17-2014
grep itself can count the matches:
Code:
grep -c -i base *

And you can restrict the search to words (e.g. match base but not basement):
Code:
grep -c -i -w base *

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

csplit not behaving

I have a large file with the first 2 characters of each line determining the type of record. type 03 being a subheader and then it will have multiple 04 records. eg: 03,xxx,xxxx,xxxx 04,xxxxxxxxxxxxxxxxxxxxxxxxxxxx 04,xxxxxxxxxxxxxxxxxxxxxxxxxxxx 03,xxx,xxx,xxx ... (2 Replies)
Discussion started by: badg3r
2 Replies

2. UNIX for Advanced & Expert Users

/etc/hosts on Ubuntu behaving strangely

Hy guys, I'm having a very strange problem, every time I change the /etc/hosts file on an Ubuntu machine @ work, every time I change the line: 127.0.0.1 programmer.COMPANY to 127.0.0.1 programmer.COMPANY programmer It works till the next reboot, now, I have never experienced this on... (5 Replies)
Discussion started by: Zarnick
5 Replies

3. Shell Programming and Scripting

tr command behaving unexpectedly

Im trying to execute the below command on our server to list files and replace the newline in the file list with spaces, but the character 'n' is getting replaced with a space, is there any environment variable that needs to be set in UNIX? sh -c 'ls -trx... (1 Reply)
Discussion started by: rameshrr3
1 Replies

4. UNIX for Advanced & Expert Users

FTP behaving erraneous way

Hi Gurus, I tried FTP one file to UNIX which got values like wel^come If I see the content in unix, it shows like wel^Zcome ^ coverted into ^Z (Control + Z ) Can someone please share what is happening here? Thanks, Shahnaz (5 Replies)
Discussion started by: shahnazurs
5 Replies

5. UNIX for Dummies Questions & Answers

Uniq command behaving odd

My file has k s j v l k a s f l k s a d f j l a s (3 Replies)
Discussion started by: phoenix_nebula
3 Replies

6. Shell Programming and Scripting

sed and cut behaving differently

I have attached a file with few records. First 2 characters of each record are binary characters. I can remove it by and it works fine. But is behaving differently and removing more than expected characters. Can someone help me in accomplishing it through sed? Thanks in advance. (13 Replies)
Discussion started by: amicon007
13 Replies

7. Red Hat

nslookup behaving strangely

I have two servers on same domain. one can nslookup other cannot Psu100 can lookup to psu000, psu010 & psu011 Psu110 can NOT lookup to psu000, psu010 & psu011 I verified resolv.conf entries on both psu000 and psu010 and it contains both name servers (10.200.10.21 & 10.200.11.22).I am... (1 Reply)
Discussion started by: scorohan
1 Replies

8. Shell Programming and Scripting

Grep command behaving strangely

Hi, I need to count number of '$' symbol in a file and assign it to a variable. I am using below command. grep -c '\$' inputfile O/p: 10359 Its giving correct o/p but when I am assigning the same to a variable its giving completely different o/p. ab1=`grep -c '\$' inputfile` $... (3 Replies)
Discussion started by: Opamps123
3 Replies

9. Programming

Application behaving in 3 different ways on 3 different machines

Hello. During the holidays I've been developing an application on my desktop computer at home. I setup a repository on github, so when I got back to work I cloned the repo to my laptop. It wouldn't work. The app is comprised of a client and a server, strangely enough the server would segfault... (10 Replies)
Discussion started by: erupter
10 Replies

10. Shell Programming and Scripting

awk not behaving as expected

Hi, Immediate help on below will be appreciated. I have to read a file (max of 10MB) which will have no new line characters, i.e. data in single line. and have to inster '\n' at every 100 characters. and if record starts with 'BUCA' then need to pick value of length 10 at position 71 and... (7 Replies)
Discussion started by: maks475
7 Replies
sdp_delete_all_field(3COMMPUTIL)	     Communication Protocol Parser Utilities Library Functions		  sdp_delete_all_field(3COMMPUTIL)

NAME
sdp_delete_all_field, sdp_delete_all_media_field - delete all SDP fields SYNOPSIS
cc [ flag...] file... -lcommputil [ library...] #include <sdp.h> int sdp_delete_all_field(sdp_session_t *session, const char field); int sdp_delete_all_media_field(sdp_media_t *media, const char field); DESCRIPTION
The sdp_delete_all_field() function deletes all the occurrences of the specified SDP field from the session structure. For example, if the session structure has 3 bandwidth (b=) fields, then when this function is called with SDP_BANDWIDTH_FIELD, all the three bandwidth fields are deleted from the session structure. The sdp_delete_all_media_field() function deletes all the occurrences of the specified SDP field from the specified media structure. For example, if the caller wants to delete all the attribute fields in a media structure, calling this function with SDP_ATTRIBUTE_FIELD argu- ment would delete all the attribute fields in the media structure. RETURN VALUES
Upon successful completion, these functions return 0. Otherwise, the appropriate error value is returned. The value of errno is not changed by these calls in the event of an error. ERRORS
These functions will fail if: EINVAL The session or media argument is NULL or the field type is unknown. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
libcommputil(3LIB), attributes(5) SunOS 5.11 12 Oct 2007 sdp_delete_all_field(3COMMPUTIL)
All times are GMT -4. The time now is 12:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy