• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Linux command help


High On Life!
So i got some help and did the command, but its not doing it correctly according to the submission script i get 0 lines correct and 0 in the right order.

From the file ~unx122/public/data.txt, select all of the lines that
have a word in column one which starts with a vowel and ends with a consonant
and have two even digits in the last column..

Sort these lines in reverse order according to column 4, then
select lines 0 through 52. Finally, put these lines in
normal order according to column 3 and write them to the file
~/uli101_a2_output.txt (overwrite any data already in that file).

grep '^[aeiouAEIOU][a-zA-Z]*[^aeiouAEIOU] .*[02468]\{2\}$' ~unx122/public/data.txt | sort -r +3 | head -53 | sort +2 > uli101_a2_output.txt


High On Life!
well its a text fille with 18000 lines, first it has a word, then a space and a four digit number then a space, then another four digit number and another, and another etc.


High On Life!
grep '^[aeiouAEIOU][a-zA-Z]*[^aeiouAEIOU] .*[0-9|02468]\{4\}$' ~unx122/public/data.txt | sort -r +3 | head -53 | sort +2 > uli101_a2_output.txt

gets me 12 in the correct position, and 40 lines correct, out of the 53, i need 53 on both :) im sorry to keep bugin u guys, but i need to submit this by 11:59 pm and im panicing, i cant figure it out


Debiant by way of Ubuntu
Hate to say this - but if you're in a hurry you need to consider the right forum!

Check out here and esp. their freenode IRC channel, if approached right you may get instant help there (say MFG sent ya if it helps!)


High On Life!
no one replied on the other forum help please in anyway, i dont wanna turn it in late, i hate doing that ive been working on it for the last couple of hours with no luck


High On Life!
irc doesnt work here on my school connection at all, im trying though but still doesnt connect, my school connection is really stupid, could you please ask for me mfg? im really sorry to bug u like this rep again once i can :dead:


High On Life!

i emailed the teacher earlier today because he said if u need help email me ur output input instructions etc, i did but he didnt reply, and frankly i am not ganna accept a late mark on this because we never learnt this complex in grep etc, im really mad how can they give us things that we didnt learn


High On Life!
YAY I GOT IT!!!! i had the idea of checking the script that checks and me and fisgboy went it and found what it was looking for, the correct one is this
grep -i '^[aeiou][a-z]*[^aeiou] .*[24680][0-9]*[24680][0-9]*$'
but for this i thought it would just do the last two digits, but what do i know they are probably right

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member