19,047 reputation
23971
bio website
location United States
age
visits member for 2 years, 11 months
seen 8 hours ago

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


Jun
13
comment Looping the listing files in UNIX
What are you trying to accomplish?
Jun
13
comment Why does vim color this .bashrc line incorrectly? Fixable?
What Vim version do you have? I tried pasting that sqlplus line into my bashrc and Vim 7.3 highlights it correctly. What is your filetype set to? (:set ft? or :echo &ft). Since the highlighting in your image is wrong but the bash syntax is correct, either you have the wrong filetype or the syntax file you have in your Vim is bugged.
Jun
11
answered AWK: Nested Conditional Subset of Rows without Headers
Jun
10
comment Guard against killing an already killed process
@JosephR. The right solution to that (completely different problem) is something along the lines of kill pid || true. When all you have is a PID, it is impossible to avoid race conditions if the state of the PID changes between when you check it and when you try to do something with it.
Jun
10
comment Guard against killing an already killed process
If the PID does not exist because the process has already completed, the kill command will be completely harmless. Why do you even need to check this?
Jun
6
awarded  Student
Jun
6
asked Escape on Control key, Control on Capslock key, Capslock on Escape key
Jun
6
comment sed's c command outputs current line no matter what
This behavior for the c command is also specified by POSIX: "Delete the pattern space. With a 0 or 1 address or at the end of a 2-address range, place text on the output and start the next cycle."
Jun
6
revised Explanation of version build time as opposed to version number, eg OpenSSL 1.0.1e versus h
added 8 characters in body
Jun
6
awarded  Enlightened
Jun
6
awarded  Nice Answer
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 }."