Enjoy Hull...some of us are having to spend more time in Grimsby. It makes you appreciate the place
Announcement
Collapse
No announcement yet.
Help with unix commands
Collapse
X
-
kaak@kaak.net>I commaaand youu to obeyyy they woord of the Lord, which tells you to CHANGE DIRECTORY!
There are soem more basic commands, so what do you need?In da butt.
"Do not worry if others do not understand you. Instead worry if you do not understand others." - Confucius
THE UNDEFEATED SUPERCITIZEN w:4 t:2 l:1 (DON'T ASK!)
"God is dead" - Nietzsche. "Nietzsche is dead" - God.
Comment
-
Well, it was inevitable, I decided to start testing these regexes...
$ cat databook
0:04:01:10:wh00t
0:10:12:05:l33t-2003
0:01:01:01:666
0:04:15:11:324
0:04:15:12:k3wl
$ sed -n '/^[^:]*:[^:]*:[^:]*:11/p' databook
0:04:15:11:324
This one prints November's records, as it's supposed to...
$ sed -n '/^[^:]*:[^:]*:[^:]*:\(11\)\|\(12\)/p' databook
0:10:12:05:l33t-2003
0:04:15:11:324
0:04:15:12:k3wl
I'l figure out why this one produces wrong results later, if I can be bothered... (it probably picks up the 12 in the third column for some reason)
$ sed -n '/^[^:]*:[^:]*:[^:]*:1[12]/p' databook
0:04:15:11:324
0:04:15:12:k3wl
This one does exactly what it's supposed to do.
$ sed -n '/^(.*?{3}1[12]/p' databook
And this one doesn't seem to do anything... however, a fixed version of it does:
$ sed -n '/^\(.*:\)\{3\}1[12]/p' databook
0:04:15:11:324
0:04:15:12:k3wl
As does a version that might be safer, or then not, I'm not really sure:
$ sed -n '/^\([^:]*:\)\{3\}1[12]/p' databook
0:04:15:11:324
0:04:15:12:k3wl
No, I for one have not understood sed's rules about what needs to be escaped and what not in regexes...This is Shireroth, and Giant Squid will brutally murder me if I ever remove this link from my signature | In the end it won't be love that saves us, it will be mathematics | So many people have this concept of God the Avenger. I see God as the ultimate sense of humor -- SlowwHand
Comment
-
I'm almost ashamed about the acts of l33tism I committed. I guess I've picked it up at the Gentoo forums where the user levels are in l33t, probably (hopefully) as a joke...This is Shireroth, and Giant Squid will brutally murder me if I ever remove this link from my signature | In the end it won't be love that saves us, it will be mathematics | So many people have this concept of God the Avenger. I see God as the ultimate sense of humor -- SlowwHand
Comment
-
He's just playing dumb Rich.(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
Comment
-
([3^4]*1:2(4)])$^¨b12Eventis is the only refuge of the spammer. Join us now.
Long live teh paranoia smiley!
Comment
Comment