04-24-2001
hello, i'm trying to pluck words from a list that have exactly 3 occurances of a specified letter. I've come up with this :
grep -i .*$1.*$1.*$1.*
But this also selects words with 4 or more, any tips?
I'm putting this into a shell procedure and want to be able to add a switch before I put the letter to searched in ($1), if you could point me to the correct manual page to read up on that it would be great, I'm using bourne shell.
Thanks in advance
Steve
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I write a sh script that zip and copy to tape all files that older then 2 hours.
1. The way I choose is - touch a file with "now - 2 hours", then use fine with '! -newer'
2. Do you have any other idea to do it ?
tnx. (1 Reply)
Discussion started by: yairon
1 Replies
2. UNIX for Dummies Questions & Answers
when ever i type it in it always looks like so
echo $file | sed 's/~/\
/g'
how can i get it on one line? (6 Replies)
Discussion started by: Optimus_P
6 Replies
3. UNIX for Dummies Questions & Answers
I am kind of new with Unix and I really need some help. Can you please tell me what the 'whatis' command is? and what does it do?
Let's say that I have a file which I want to delete, what command will I need to use?
If I have a directory that I want to delete all files from what command do... (11 Replies)
Discussion started by: mischiefdemon
11 Replies
4. UNIX for Dummies Questions & Answers
my solaris text talks about the 'find' command... it further goes to talk about an "action" used with the find command.
I am completely confused as to what the {} do with the find comand.
the explanation is this: "A set of braces, {}, delimits where the file name is passed to the command from... (2 Replies)
Discussion started by: xyyz
2 Replies
5. Shell Programming and Scripting
I wonder how I shall read the result below, especially 'what'
shown below.
The result was shown when I entered 'w'.
E.g what is TOP? What is gosh ( what does selmgr mean?)?
login@ idle JCPU PCPU what
6:15am 7:04 39 39 TOP
6:34am 6:45 45 45 TOP
6:41am ... (1 Reply)
Discussion started by: Aelgen
1 Replies
6. UNIX for Dummies Questions & Answers
Hi Gurus,
I would appreciate if someone could enlighten this newbie as to how significant the '&' is to unix.
Currently I am getting around to writing a script which has to deal with a lot of these ampersands either as starting chars or between chars.
Please find below the simpliest way that I... (4 Replies)
Discussion started by: buRst
4 Replies
7. Shell Programming and Scripting
I am trying to run the following code from a script file but it complains that syntax of (both instances of) grep is wrong.
When I copy and paste it to the terminal, it is OK. Any idea what the problem might be?
set i = `grep -c #define flags.h`
while ($i>20)
@ i--
my func (`cat... (4 Replies)
Discussion started by: barisgultekin
4 Replies
8. UNIX for Dummies Questions & Answers
I apologize is this is somewhere else but I did look....
Is there a command to goto position # x within the VI editor? I've seen where you can search for a particular char string but I need to go to position 200 within a record (tired of counting positions)...:)
Thanks in advance... (2 Replies)
Discussion started by: hedrict
2 Replies
9. UNIX for Dummies Questions & Answers
Hi
I am having a 'grep' headache
Here is the contents of my file:
(PBZ,CP,(((ME,PBZ,BtM),ON),((ME,((PBZ,DG),(CW9,PG11))),CW9,TS2,RT1)))
I would like to count out how many times 'PBZ' occurs and then place that number in the line above
3... (8 Replies)
Discussion started by: cavanac2
8 Replies
10. Shell Programming and Scripting
I'm new using Unix commands in applescript. The following script you choose different folders with PDfs, get file count of PDfs on chosen folders, & write the results in text file.
set target_folder to choose folder with prompt "Choose target folders containing only PDFs to count files" with... (0 Replies)
Discussion started by: nellbern
0 Replies
LEARN ABOUT NETBSD
boggle
BOGGLE(6) BSD Games Manual BOGGLE(6)
NAME
boggle -- word search game
SYNOPSIS
boggle [-bd] [-s seed] [-t time] [-w length] [+ [+]] [boardspec]
DESCRIPTION
The object of boggle is to find as many words as possible on the Boggle board within the three minute time limit. A Boggle board is a four
by four arrangement of Boggle cubes, each side of each cube displaying a letter of the alphabet or `qu'. Words are formed by finding a
sequence of cubes (letters) that are in the game's dictionary. The (N+1)th cube in the word must be horizontally, vertically, or diagonally
adjacent to the Nth cube. Cubes cannot be reused. Words consist solely of lower case letters and must be at least 3 letters long.
Command line flags can be given to change the rules of the game.
-b Run boggle in batch mode. A boardspec must also be given. The dictionary is read from stdin and a list of words appearing in
boardspec is printed to stdout.
-d Enable debugging output.
-s seed Specify a seed seed other than the time of day.
-t time Set the time limit for each game from the default 3 minutes to time seconds.
-w length Change the minimum word length from 3 letters to length.
+ This flag allows a cube to be used multiple times, but not in succession.
++ This flag allows the same cubes to be considered adjacent to itself.
boardspec A starting board position can be specified on the command line by listing the board left to right and top to bottom.
Help is available during play by typing '?'. More detailed information on the game is given there.
AUTHORS
Boggle is a trademark of Parker Brothers.
Barry Brachman
Dept. of Computer Science
University of British Columbia
BUGS
If there are a great many words in the cube the final display of the words may scroll off of the screen. (On a 25 line screen about 130
words can be displayed.)
No word can contain a 'q' that is not immediately followed by a 'u'.
When using the + or ++ options the display of words found in the board doesn't indicate reused cubes.
The dictionary that NetBSD installs omits many words that belong in the English language, most notably inflected forms.
BSD
September 23, 2006 BSD