Sponsored Content
Top Forums UNIX for Dummies Questions & Answers BASH - Counting word occurrences in a Web Page Post 302747663 by Scott on Saturday 22nd of December 2012 06:21:49 AM
Old 12-22-2012
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count the number of occurrences of the word

I am a newbie in UNIX shell script and seeking help on this UNIX function. Please give me a hand. Thanks. I have a large file. Named as 'MyFile'. It was tab-delmited. I am told to write a shell function that counts the number of occurrences of the ord “mysring” in the file 'MyFile'. (1 Reply)
Discussion started by: duke0001
1 Replies

2. Shell Programming and Scripting

counting number of pattern occurrences

Hi All, Is it possible to count number of occurrences of a pattern in a single record using awk?? for example: a line like this: abrsjdfhafa I want to count the number of a character occurrences. but still use the default RS, I don't want to set RS to single character. (1 Reply)
Discussion started by: ghoda2_10
1 Replies

3. Homework & Coursework Questions

Du without directory and Grep for occurrences of a word

Assistance on work Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Files stored in ... (1 Reply)
Discussion started by: alindner
1 Replies

4. Shell Programming and Scripting

Counting occurrences of all words in multiple files

Hey Unix gurus, I would like to count the number occurrences of all the words (regardless of case) across multiple files, preferably outputting them in descending order of occurrence. This is well beyond my paltry shell scripting ability. Researching, I can find many scripts/commands that... (4 Replies)
Discussion started by: twjolson
4 Replies

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

6. Shell Programming and Scripting

Counting non-specific occurrences within a file.

I'm pretty new to scripting and didn't see an example of this issue yet. I am trying to count and print the total number of times each value is found within a file. Here is a short example of my starting file. value 3 value 3 value 3 value 3 value 4 value 6 value 6 value 6 value 6... (3 Replies)
Discussion started by: funkynmr
3 Replies

7. UNIX for Dummies Questions & Answers

Awk: Counting occurrences between two files

Hi, I have two text files (1.txt and 2.txt). 2.txt contains two columns which are extracted from 1.txt using a simple if(condition) print. I want to: - count how many times the values contained in 2.txt appear in 1.txt -if they appear just one time, I have to delete the entire row in... (5 Replies)
Discussion started by: Pintug
5 Replies

8. UNIX for Advanced & Expert Users

Find 2 occurrences of a word and print file names

I was thinking something like this but it always gets rid of the file location. grep -roh base. | wc -l find . -type f -exec grep -o base {} \; | wc -l Would this be a job for awk? Would I need to store the file locations in an array? (3 Replies)
Discussion started by: cokedude
3 Replies

9. Shell Programming and Scripting

Word Occurrences script using awk

I'm putting together a script that will the count the occurrences of words in text documents. It works fine so far, but I'd like to make a couple tweaks/additions: 1) I'm having a hard time displaying the array index number, tried freq which just spit 0's back at me 2) Is there any way to... (12 Replies)
Discussion started by: ksmarine1980
12 Replies

10. Shell Programming and Scripting

Refresh web page in bash script

hello, I am trying to refresh my web page which is created in bash script. I have a HTML page which when press a button calls a bash script. this bash script created the same page with dynamic data. When pressing the button I am calling to a function that set time out of 7 seconds and and after... (1 Reply)
Discussion started by: SH78
1 Replies
auditmask(8)						      System Manager's Manual						      auditmask(8)

Name
       auditmask - get or set auditmasks

Syntax
       auditmask [ option ...  ] [ event[:succeed:fail]

Description
       The  command  with  no  arguments displays the system-calls and trusted-events currently being audited for the system, and displays whether
       they are being audited under successful or failed occurrences or both.  The format used for the display is acceptable as input to the  com-
       mand.

       The command with event arguments sets the system-call and trusted-event audit masks for the system.  This is cumulative operation, so it is
       possible to turn on or off audit for one set of events, then turn on or off audit for a second set of events without changing the first set
       of  events (except for intersection between the two sets).  Command line arguments to can include one or more events, each with an optional
       field :succeed:fail, where succeed is either 0 to specify no auditing of successful occurrences of event, or 1 (or any non-zero	character)
       to specify auditing of successful occurrences of event; and fail is either 0 to specify no auditing of failed occurrences of event or 1 (or
       any non-zero character) to specify auditing of failed occurrences of event.  The event name is the system-call name  or	the  trusted-event
       name (see audit.h ).

       The command will also accept redirected input, which can be the output of a previously issued command.  This is a file which contains lines
       of the format event [succeed][fail].  If the keyword succeed is present, successful occurrences of that event will be audited; if the  key-
       word  fail  is  present,  failed  occurrences of that event will be audited; if both are present, successful and failed occurrences will be
       audited; if neither keyword is present, that event will not be audited.

       The auditmask command can also be used to set the audit style characteristics of the audit subsystem.  These  characteristics  control  how
       much information is recorded on exec operations.

       The  command  is  used in to initialize the auditmask at boot time according to the file This makes use of privileged operations within the
       system call.

Options
       -f	   Turns on full auditing for the system.  This list may include events which have no symbolic name and are represented only by  a
		   number (reserved for future use); these events will not be audited, despite their presence in the auditmask.

       -n	   Turns off all auditing for the system.

       -s aud_style
		   An  aud_style  of  "exec_argp" enables the auditing of the argument list to an or syscall.  An aud_style of "exec_envp" enables
		   the auditing of the environment strings to an or syscall.

See Also
       audcntl(2)

																      auditmask(8)
All times are GMT -4. The time now is 08:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy