19,547 reputation
34173
bio website
location United States
age
visits member for 3 years, 1 month
seen 1 hour ago

Debian user, GNU/Linux enthusiast, FLOSS supporter, hobby developer.


Jun
3
comment dd: 'bs', 'count' & 'seek'
Try the GNU documentation for dd or the POSIX version.
Jun
3
comment Exiting a '&pattern' search in less
& with an empty pattern should work. What version of less do you have? Have you checked man less?
Jun
3
comment Why is Aircrack-ng able to read and use a .lst file that Leafpad couldn't in a reasonable time?
@just There's not enough information to answer that for sure without knowing the specific hardware and software configuration being used. I would bet that most password protection schemes in use today are more CPU-bound than memory bound.
May
30
comment POSIX usage standards for requiring at least one optional arg
The easiest way around this is to make both optional, in one of two ways: (a) provide a default action for the no argument case or (b) print an error message and exit. As far as I can tell, the POSIX Utility Conventions do not have a way to express the "one or more of the following set, but at most one of each" requirement. You could also imitate dd, and just call it field_id which you explain in the details.
May
29
comment How can I get the first column of a 300GB txt file?
I would guess OP is using mawk which is a popular default implementation of awk on many distributions and does indeed have the 32767 field limit.
May
29
comment How can I get the first column of a 300GB txt file?
@JovanAndonov The * is greedy and since . matches everything, you will just get /ns/everything from first/ns/to the end of the line.
May
27
comment Some puzzles of how to close file descriptors on sh or bash
See also this question: unix.stackexchange.com/q/131801/9537
May
27
comment shell or python script to transpose rows to columns
Try unix.stackexchange.com/q/79642/9537, and stackoverflow.com/q/1729824/855954
May
26
comment compare columns in a one file and print the count of matches
@RincyRaphael I am only answering what you have in your question. If you want something put it in your question. Your question says "Expected output: 2" so that is what I gave you. If you want something else ask for it. I can not read your mind.
May
26
comment compare columns in a one file and print the count of matches
@RincyRaphael I see your new question edit. If you don't ask the right question you won't get the right answer. I will ask again - are there blank lines in your input like you have in your question?
May
20
comment Difference between cat and '>' to zero out a file
@StephaneChazelas What do you make of 1.c in Command Search and Execution? The way I interpret it, true must bypass PATH lookup and unless a shell hardcodes a fixed path to an external true binary, the only way it can meet that requirement is to make the listed utilities built-in.
May
20
comment Difference between cat and '>' to zero out a file
There is a time and a place for everything. Your information may be useful in some other context but it does not belong here - you should find a more appropriate place for it because nobody trying to rotate logs is going to look in this completely unrelated redirection question. Here your answer is the equivalent of a digital weed, just as an otherwise useful pumpkin plant in the middle of a cornfield would be considered a weed.
May
19
comment How to fix the accents in xterm top bar?
Try using the Debian uxterm or lxterm wrappers.
May
19
comment Difference between cat and '>' to zero out a file
Very little of this answer actually is relevant to or answers the question. The difference between a cat /dev/null > file and a > file is a cat /dev/null and that makes no difference to the file.
May
19
comment Difference between cat and '>' to zero out a file
@Patrick The phrase "special utility" does not appear anywhere. The link I gave explains the difference between a special built-in and a regular built-in: however, the special built-in utilities described here differ from regular built-in utilities in two respects: ... What do you mean by special utility?
May
19
comment Difference between cat and '>' to zero out a file
@kojiro : is also mandated by POSIX to be built-in, and in fact is different from true in that it is considered a "special" built-in.
May
16
comment Some puzzles of how to close file descriptors on sh or bash
You raise a good point about <>. It appears POSIX may be a bit under-specified here, and there does not seem to be a "good" answer to your question. If you need to use <> in a POSIX environment, it seems like a fairly safe assumption that on most implementations any one of >&- and <&- will work though.
May
16
comment To env or not to env
@JohnCromartie It's an optional component of every shell command, so it is in the "Simple Commands" section of most shell manuals. For POSIX, that would be here. glenn linked the analogous section from the bash manual for you already.
May
16
comment Some puzzles of how to close file descriptors on sh or bash
In practice, closing a file descriptor in the shell probably means using the close() system interface, which works on all file descriptors regardless of what mode they were opened in. This is probably why closing shell file descriptors with the wrong operator still works. However, nowhere does POSIX guarantee this will work, so it would be unwise to rely on such behavior.
May
16
comment Some puzzles of how to close file descriptors on sh or bash
Your syntax is wrong. To close a descriptor you need &-. A - by itself creates a file called -. You probably have a few of those from your testing now.