19,257 reputation
34072
bio website
location United States
age
visits member for 3 years
seen 8 hours ago

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


Jun
5
comment awk command for parsing a file
@user3138373 Try it and see! (But yes, you are right)
Jun
5
comment awk command for parsing a file
@user3138373 The 1 means "print every line", including the first. The NR > 1 means every line except the first. Since you want to print every line but you do not want to edit the first, the 1 is used for printing and the NR > 1 is used for editing.
Jun
5
revised awk command for parsing a file
added 7 characters in body
Jun
5
comment set the default keyboard type to ascii mode
You may be mixing up terms here. ASCII only covers character codes 0-127, and overlaps exactly with UTF-8 (meaning 0-127 mean the same thing in both ASCII and UTF-8). From your question it looks like you are using ISO-8859-1, which is an extension to ASCII that is not compatible with UTF-8 (all of them share 0-127 but what 128 and beyond mean is different in ISO-8859-1 vs UTF-8).
Jun
5
answered Explanation of version build time as opposed to version number, eg OpenSSL 1.0.1e versus h
Jun
5
revised awk command for parsing a file
add tab-delimited output as stated by OP in comment
Jun
5
comment awk command for parsing a file
if ($i < 100) $i = "NA" has a body. The body is the $i = "NA" part. Braces { $i = "NA" } are unnecessary since it is only one statement.
Jun
5
comment awk command for parsing a file
@user3138373 Would it be easier to understand if I wrote 1 == 1 { print }? The 1 is basically an abbreviated version of that. To understand why it abbreviates to 1, look at my previous comment.
Jun
5
comment awk command for parsing a file
@user3138373 Using the POSIX spec, the Extended Description says, "An awk program is composed of pairs of the form: pattern { action }. Either the pattern or the action (including the enclosing brace characters) can be omitted." The 1 is simply a pattern, and the action is omitted. Further, "... a missing action shall be equivalent to: { print }."
Jun
5
revised awk command for parsing a file
respond to OFS comment
Jun
5
answered awk command for parsing a file
Jun
5
comment awk command for parsing a file
This sounds quite trivial in awk.
Jun
4
comment How to get previous year and previous month in solaris 8
As far as I know only the GNU version of date has a -d option that accepts input like last month or last year.
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
awarded  Guru