310 reputation
315
bio website
location
age
visits member for 2 years
seen 1 hour ago

Shyy erny anzr - Naqernf Rvonpu


3h
comment Trying to access environment variable (array) declared in ~/.profile from shell script
I don’t understand why you view this as a hardship. Because the script might be called repeatedly in short intervals. And hence I thought it would be a nice idea to have an array pre-built which can then be used by all subsequent script calls.
4h
asked Trying to access environment variable (array) declared in ~/.profile from shell script
1d
revised awk: Extracting a fixed number of rows where the last row number may vary
wording
Sep
10
comment awk: Extracting a fixed number of rows where the last row number may vary
Speaking of which, some regex engines even do use angle brackets for word boundary matching :) (however they won't work in either awk or gawk) ... Anyways, I think it'll be worth working on a solution that will simulate word boundary on non-GNU awk, since the blind following of GNUisms has almost become epidemic on SE/SO, and thus one of my pet peeves as well.
Sep
10
comment awk: Extracting a fixed number of rows where the last row number may vary
Caveat: Make sure you keep in mind that a \b in GNU awk (gawk) will stand for backspace, so to work correctly, the regex in my OP must be changed to / \ytop\y$/, with \y` standing for "word boundar y". This has just cost me another 15 minutes to figure out, since my regex made top keep on spitting out itself all the same, although I was sure I had filtered it out by now....BUT: this is a GNU-ism; it's not available in traditional awk implementations (neither is \b).
Sep
10
revised awk: Extracting a fixed number of rows where the last row number may vary
added 30 characters in body
Sep
10
revised awk: Extracting a fixed number of rows where the last row number may vary
bugfix (missed single end quote!!)
Sep
10
comment awk: Extracting a fixed number of rows where the last row number may vary
@G-Man Well, top displays the stuff pre-sorted already, whilst with ps you'd normally have to pipe a sort to the line to achieve the same. Unless you know about the --sort option in ps, which I had ignored...
Sep
10
revised awk: Extracting a fixed number of rows where the last row number may vary
added 21 characters in body
Sep
10
revised awk: Extracting a fixed number of rows where the last row number may vary
"bugfix": I forgot that 'top' will output in all its full glory, so the command name will be somewhere in between, and not at start of line.
Sep
9
comment awk: Extracting a fixed number of rows where the last row number may vary
Thank you! That might already be the solution. And I have nothing against your italics, for it leaves those who ask a little chance to think themselves. :) I'd always just need these general ideas, not everything word-by-word. BTW, about the count=5 bit: very sneaky! I was trying so hard with for loops, but got nowhere (except for silly output as well as annoying and totally confusing error messages from awk)
Sep
9
comment awk: Extracting a fixed number of rows where the last row number may vary
Very nice alternate solution as well, thanks! Might even take less resources than the top approach.
Sep
9
awarded  Yearling
Sep
9
revised awk: Extracting a fixed number of rows where the last row number may vary
added 11 characters in body
Sep
9
revised awk: Extracting a fixed number of rows where the last row number may vary
added 252 characters in body
Sep
9
asked awk: Extracting a fixed number of rows where the last row number may vary
Sep
1
revised How can I use wget to create a list of URLs from an index.html?
added 1 character in body
Sep
1
revised How can I use wget to create a list of URLs from an index.html?
added 161 characters in body
Sep
1
answered How can I use wget to create a list of URLs from an index.html?
Sep
1
comment wget: Retrieving a list of URLs when modifying input data file on the fly
Well, the basic problem is that there were two very useful comments which ought to have been posted as answers. However I guess this has been done on purpose, because both of the commenters were not entirely sure since they could not "live-test" it at the moment they posted it. So both of them or just one may turn theirs into an answer, and I'll put the checkmark on it. But not on my own one, that's silly.