Omega Owners Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Please play nicely.  No one wants to listen/read a keyboard warriors rants....

Pages: 1 [2]  All   Go Down

Author Topic: My unix awk commands have escaped me! :(  (Read 2365 times)

0 Members and 1 Guest are viewing this topic.

dbdb

  • Senior Member
  • ****
  • Offline Offline
  • Gender: Male
  • west london
  • Posts: 714
  • Tramlining,Trade Club,WIM,my time racing,Linux etc
    • f/l elite 2.6 V6 manual
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #15 on: 25 April 2013, 23:12:38 »

15 years since my daily use of UNIX(™) so I can recall a bit but I wouldn't be using AWK.  How about

$ cat GameBShort.log |grep '/1301/streams$' |sort -u

That should return all the lines you want but not uniquely. To get just one of each you would need to be more fancy try

$ cat GameBShort.log |grep '/1301/streams$' \{1\} |sort -u

I think.

I didn't quite get your "rows with unique username (tunnie)", do you want all users as in your example (user1, user2 etc..) or just 'tunnie'? Just tunnie is easy 

$ cat GameBShort.log |grep 'tunnie' | grep '/1301/streams$' |sort -u
Logged

Vamps

  • Offline Offline
  • Gender: Male
  • Bishop Middleham, Co Durham.
  • Posts: 24708
  • Flying Tonight, so Be Prepared.
    • Mig 2.6CDX and 2.2 Honda
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #16 on: 25 April 2013, 23:20:27 »

15 years since my daily use of UNIX(™) so I can recall a bit but I wouldn't be using AWK.  How about

$ cat GameBShort.log |grep '/1301/streams$' |sort -u

That should return all the lines you want but not uniquely. To get just one of each you would need to be more fancy try

$ cat GameBShort.log |grep '/1301/streams$' \{1\} |sort -u

I think.

I didn't quite get your "rows with unique username (tunnie)", do you want all users as in your example (user1, user2 etc..) or just 'tunnie'? Just tunnie is easy 

$ cat GameBShort.log |grep 'tunnie' | grep '/1301/streams$' |sort -u

Is that legal?.................... :-X
Logged

Turk

  • Omega Baron
  • *****
  • Offline Offline
  • Gender: Male
  • Llanelli, Wales
  • Posts: 4029
    • 2.5td, H-D XL1200
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #17 on: 25 April 2013, 23:39:20 »

'Unix Awk/Grep'   Klingon ?  :-\
Logged
Only a biker truly understands why a dog sticks it's head out of the window of a moving car.

dbdb

  • Senior Member
  • ****
  • Offline Offline
  • Gender: Male
  • west london
  • Posts: 714
  • Tramlining,Trade Club,WIM,my time racing,Linux etc
    • f/l elite 2.6 V6 manual
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #18 on: 25 April 2013, 23:47:06 »

I've removed all the difficult bits, here it is in plain english :)

cat GameBShort dot log pipe grep quote tunnie unquote pipe grep forward slash one three zero one forward slash streams dollar backslash open curly braces one backslash close curly braces pipe sort minus u
Logged

Vamps

  • Offline Offline
  • Gender: Male
  • Bishop Middleham, Co Durham.
  • Posts: 24708
  • Flying Tonight, so Be Prepared.
    • Mig 2.6CDX and 2.2 Honda
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #19 on: 25 April 2013, 23:57:14 »

I've removed all the difficult bits, here it is in plain english :)

cat GameBShort dot log pipe grep quote tunnie unquote pipe grep forward slash one three zero one forward slash streams dollar backslash open curly braces one backslash close curly braces pipe sort minus u

Thank you, that explains it all.................not....... :D :D
Logged

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #20 on: 26 April 2013, 07:54:04 »

Cheers dbdb  :y

I'll give that a go this morning  :y
Logged

CaptainZok

  • Omega Lord
  • *****
  • Offline Offline
  • Gender: Male
  • Bolton
  • Posts: 8093
  • Victim of Cyberbullying.
    • 3.2 MV6 Estate
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #21 on: 26 April 2013, 12:57:45 »

Cheers dbdb  :y

I'll give that a go this morning  :y
So that'll be sky off for the afternoon then and the student getting a slap off Uncle Rupe. ;D ;D
Logged
PM me for code reading/clearing
TuBy's new whipping boy.
Pages: 1 [2]  All   Go Up
 

Page created in 0.01 seconds with 16 queries.