n00bfest.com
Home Forum phpBB3 Shoutbox Servers Teamspeak Admins Donate FAQ
Sign Up
Stats Contact Us!

 

View unanswered posts | View active topics It is currently Thu Mar 28, 2024 3:21 am



Reply to topic  [ 5 posts ] 
 Linux/Unix Help 
Author Message
n00bfest Council
User avatar

Joined: Mon Jul 05, 2010 1:18 am
Posts: 1740
Post 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.

_________________
http://steamcommunity.com/id/Hito1220/wishlist
http://www.twitch.tv/hito1220


Thu Jan 31, 2013 3:22 pm
Profile
n00bfest Elder, Senior Admin
User avatar

Joined: Mon Apr 26, 2004 11:00 pm
Posts: 7108
Location: Texas
Post Re: Linux/Unix Help
What kind of questions?

_________________
Strange
n00bfest Member / Admin
Δ Founder
strangelegend@n00bfest.com


Thu Jan 31, 2013 6:12 pm
Profile WWW
[n00b] Member
User avatar

Joined: Wed Oct 26, 2011 8:31 pm
Posts: 397
Post Re: Linux/Unix Help
I'll help, I am familiar enough with it..


Thu Jan 31, 2013 7:33 pm
Profile
n00bfest Council
User avatar

Joined: Mon Jul 05, 2010 1:18 am
Posts: 1740
Post 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

_________________
http://steamcommunity.com/id/Hito1220/wishlist
http://www.twitch.tv/hito1220


Thu Jan 31, 2013 9:46 pm
Profile
[n00b] Member
User avatar

Joined: Wed Oct 26, 2011 8:31 pm
Posts: 397
Post 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.


Sat Feb 02, 2013 11:54 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.