n00bfest
http://n00bfest.com/phpBB3/

Linux/Unix Help
http://n00bfest.com/phpBB3/viewtopic.php?f=11&t=47778
Page 1 of 1

Author:  Hito [ Thu Jan 31, 2013 3:22 pm ]
Post subject:  Linux/Unix Help

Hey guys I'm taking a class in this stuff and I was wondering if there was anybody that was good at this shit so I can ask some questions.

Author:  Strange [ Thu Jan 31, 2013 6:12 pm ]
Post subject:  Re: Linux/Unix Help

What kind of questions?

Author:  Jason0885 [ Thu Jan 31, 2013 7:33 pm ]
Post subject:  Re: Linux/Unix Help

I'll help, I am familiar enough with it..

Author:  Hito [ Thu Jan 31, 2013 9:46 pm ]
Post subject:  Re: Linux/Unix Help

The answers to these questions require using the command grep, in some cases wc, and the dictionary file (/usr/local/tmp/Words). The dictionary is case sensitive; keep this in mind when writing your grep commands. Also, for the purposes of these questions, only a, e, i, o and u are vowels (not y), and a consonant is any character that is not a vowel (including punctuation).


First, take a look at the contents of (/usr/local/tmp/Words). Note that each word has two entries. In normal and reverse order. In addition, the first letter of each word is upper case.

Using tr, convert all upper case letters to lower case. (1 points)
Using sed, remove the reversed copy of each word. [hint] Each word is followed by it's reverse on subsequent lines. Save the output of this command as a file named "words" in your home dir for use with the remaining questions. (3 points)
Count the number of five letter words in the dictionary. (3 points)
Output all the words in the dictionary [$HOME/words] that have six (or more) consonants (non-vowels) in a row. (4 points)

Okay... so I know with tr you can do

$ tr '[:upper:]' '[:lower:]' < input.txt > output.txt

But problem I'm finding is if I put that in like that... terminal just freezes on me when I type $ tr '[:upper:]' '[:lower:]' < Words > Words

Author:  Jason0885 [ Sat Feb 02, 2013 11:54 am ]
Post subject:  Re: Linux/Unix Help

Maybe if you had it create a new document instead of trying to update the one you are modifying? I'm not sure if you have already tried that, but would be my first guess.

Like, $ tr '[:upper:]' '[:lower:]' < Words.txt > Words2.txt

I'm not too sure grep isn't my cup of tea..


I did find this website, http://www.softpanorama.info/Tools/tr.shtml . It seems to have a lot of useful info on tr.

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/