| |
| |
| |
|
Page: 1 2
Comments:
<0> Any good suggestions for dealing with elapsed time stamps (ddd-HH:MM:SS format) and converting to something standard and parseable (elapsed seconds or elapsed minutes would be good). <1> Well, the lazy thing to do is to make all of the seperators the same. <1> So that is what I would do first. <0> newmanbe: Point. At the same time I could just parse it out. <0> Hrm. <1> Give an example input and output. <2> karsten: date -d "22 Fri Oct 22 16:15:08 2004" +%s <0> root 1 0 S 0.0 00:00:40 90-00:28:25 476 3636 ? init <0> Column 7 <0> I'm tracking down long-lived processes on a grid. <0> For a given list of users, there shouldn't be any processes without a seperate (batch submission system) job entry. <0> ... which is timestamped eg: "Feb 8 16:14" <0> ... I need to compare timestamp w/ elapsed time for any processes for which the user _does_ have a current job entry. <0> First output si from 'ps' with a format string supplied. I've got an existing shell script which ensures output is largely uniform across different hosts (varying 'Nix OSs, architectures). <3> karsten: Easy. <3> karsten: How you doin'?
<0> pr3d4t0r: Better than Vickie Lynn Hogan <0> pr3d4t0r: Better known as Anna Nichole. <4> ah <4> Gold Digger <0> goldfish: Dead digger <4> She died? <0> http://news.google.com/?ncl=1113457815&hl=en <4> haha <4> Deadly. <4> I wonder who will get her money. <0> The guy who was with her when she died, perhaps. <4> Interesting. <0> ... who was also with her when her son died in the bahamas. <0> Howard K. Stern. <0> No, not _that_ Howard Stern. <0> Lawyer, 37. <4> I don't know who that one is :) <4> Name is familair though. <0> Wikipedia article. <4> It would be very ironic if the son of her old husband got all the money. <0> http://en.wikipedia.org/wiki/Howard_K._Stern <4> :-) <0> Particularly as he's dead. <4> haha <4> I should keep up more with america. <0> Truth to tell, there's bits of this I've only become aware of in the past hour. <0> Weird part is I got a call this morning for a Vickie Lynn H. Different last name though. Wrong number. <4> lol <0> But right after I typed in the response to pr3d4t0r above I had a freak moment. Just replayed the voicemail, it's not the same name. <4> :) <0> Still pretty random though. <3> Such a tragic life. <4> lol. <5> hehe <0> Innit jes? <3> http://img172.imageshack.us/img172/6959/1157960476967zi8.jpg <4> :-) <0> SFW? <0> Needs a "I"m Unix"... <6> pr3d4t0r: you might want to add some .htaccess mod_rewrite stuff. so you could access the post with http://www.eugeneciurana.com/pastebin/2 http://www.eugeneciurana.com/pastebin/pastebin.php?show=2 or however? <6> It woudn't be a big deal. well just in case <6> ah well, it's not that much shorter so <3> calmar: I'll check on that. <3> calmar: Maybe a link to cime.net/p or something (another one of my domains). <6> pr3d4t0r: http://corz.org/serv/tricks/htaccess2.php there are some examples <6> the one where he redirects the blog thing maybe <7> awk '/Iowa/,/Montana/' prints the lines between those 2 expressions - how would I print everything but that pattern space ? <7> I thought something like: '!/Iowa/,/Montana/' but obviously doesn't work <4> The pattern1, pattern2 form of an expression is called a range pattern. It matches all input records starting with a record that matches pattern1, and continuing until a record <4> that matches pattern2, inclusive. It does not combine with any other sort of pattern expression. <4> Does it have to be awk? <4> awk '/Iowa/{i++}/Montana/{i--;next}(!i){print}' <4> that will break if Iowa occours more than once <4> it was just a simple example <4> bleh <4> nm <8> L|NUX <9> hey <8> yo join #xmb
<9> ok <10> L|NUX there <11> how in awk can i print lines starting from the last 4? <12> Zap-W: always keep trcak of the last four lines and print them when you hit the end <11> sounds complicated <12> Zap-W: you know about the tail command, right? <11> hey <11> back <11> yes, i want to use all in awk without tail <4> awk '{i[j++]=$0} END{k=j-4;for(k;k<j;k++){print i[k]}}' <6> printing $2...$NF , would anybody have an idea about that? I use a loop actually. hm http://tinyurl.com/25mwlm <4> nothing at that url <4> for loop, yeah <4> or use cut. <6> http://www.eugeneciurana.com/pastebin/pastebin.php?show=2171 (that one) <4> nope <4> cut(1) :) <4> cut -f2- <6> oh, I see. ah ok, then the loop probably is ok :) thanks <4> yeah im not getting anything at that url <4> awk '{print substr($0,length($1)+2)}' <4> ***uming your field seperator is 1 char <6> http://pastebin.ca/346615 ;) <6> I see. that would be an option. I do that (the second time where I need it), thx a lot <13> hi! <6> goldfish: works nice, thanks! <6> hi LZMA <13> If I do a diff of two files, theres always the ">" infront of the important part . eg: "> sda1" how can i remove the ">"? <6> LZMA: what do you want to do actually? <11> bah gotta go workout <6> sed 's/^>//' but well <13> diff /bla.txt /blaa.txt has the output "> sda1" Then I want to use awk to remove the > and the space in front of sda1 <13> so that the output is "sda1" <6> awk '{ sub(/^> /,""); print;}' <6> (or only those files beginning with > maybe? <6> ) <13> calmar, perfect! that's what I needed! Thank you <6> hm, all right <13> bye <8> goldfish, awk '{ sub(/^/, "\x01", $4 ) ; sub(/.*\x01/, "" ) ; print }' <4> What's this?! <8> to print from $4+ <3> sayajin-god: HeH. <14> gg <3> sayajin-god: That looks over-engineered. <14> its the fastest best way <3> sayajin-god: Do you have a resume for me in PDF format that I can shop around? I have my monthly call with CS on Tue or Wed next week. <14> mirc ****s, doesnt even highlight.. its crap written by noobs for serval reasons <14> a friend should have made one, but he went <3> Anyway... time to leave. Business demands my attention. <3> Cheers! <14> gg, laters <4> fastest? :-) <14> maybe, try benchmarking <14> you need printf "%s%s", $field, OFS <14> and removing the last OFS, is difficult <14> so you need to build a string within the loop, then print it <14> try, good experience for ya <14> so you need a substr op or sub op after the loop <6> or maybe printing up the next to last and printing the last manually? <6> awk '{ sub(/^/, "\x01", $4 ) ; sub(/.*\x01/, "" ) ; print }' real 0m1.385s <6> aeh, wrong <6> file: 1 2 3 4 ...20 <6> time awk '{for (i=10;i< (NF-1);i++){ printf ("%s%s",$i, OFS);}print $NF}' dddd real: 0m1.385s <6> time awk '{ sub(/^/, "\x01", $10 ) ; sub(/.*\x01/, "" ) ; print }' dddd real: 0m0.604s <6> file contains 32000 lines so <4> awk '{print substr($0,length($1)+2)}' <4> try that way <6> ok <4> replace $1 with whatever <6> time awk '{print substr($0,length($1)+2)}' dddd real: 0.610s
Return to
#awk or Go to some related
logs:
#web kmilo ubuntu nvram #fedora opencubicplayer ubuntu perl -e fork while fork #lisp postfix chroot sasl unknown password verifier #fedora Xorg 7.2 could not find default font perl shell escape
|
|