449 reputation
27
bio website dannysauer.com
location Illinois
age 37
visits member for 4 years, 7 months
seen 21 hours ago
Unix + car geek, general jack-of-all-trades, master of some :)

Feb
20
comment Replace string in string but not when its somewhere between double square bracket
Lots of people don't like perl, and it's always good to have multiple possible solutions. Especially solutions which don't contain a zillion slashes like my perl regexp. :)
Feb
20
comment Replace string in string but not when its somewhere between double square bracket
This will not replace Term if it appears anywhere after a link on the line, and does not differentiate between a [ or [[. Of course, although it doesn't work in the general case, it may solve this specific problem. :)
Feb
20
answered Replace string in string but not when its somewhere between double square bracket
Feb
20
awarded  Yearling
Feb
20
comment How can sed find pattern in one field but append another(same row)
Regarding a range, in the sed documentation a single address is referred to as a "singleton". A "singleton" is a set with one element. The address is thus a tuple with a cardinality of 0, 1, or 2. A range does not need to be two different addresses (sed -n '1,1'p behaves the same as sed -n '1p'`), so it seems reasonable to consider the singleton case as syntactic shorthand for a range where the start and end points are identical. Which is how it's implemented by match_address_p in the source.
Feb
20
comment How can sed find pattern in one field but append another(same row)
The phrase "address expression" is referring to an address defined by a regular expression. Try running sed '/barlow' and look at the error message; it says "address regexp", which is shorthand for "address regular expression".
Feb
19
awarded  Editor
Feb
19
revised How can sed find pattern in one field but append another(same row)
Fixed "address range" terminology.
Feb
19
comment How can sed find pattern in one field but append another(same row)
It's an "address range" expressed in the form of a single address - which is arguably just a very short short range. I used unclear terminology, and forgot to go back and fix it after that dawned upon me. :) It's edited now.
Feb
19
answered Tail and grep recursively?
Feb
19
awarded  Citizen Patrol
Feb
19
comment How to delete a line from a file that requires permission such as visudo using sed?
Further, you need to add "timestamp_timeout", not "timestamp". And the sed should really delete one line matching "Defaults timestamp_timeout=20", not five lines from the file. This whole scenario is suspect.
Feb
19
comment How to delete a line from a file that requires permission such as visudo using sed?
The error message you posted indicates that the "d" was not there when you ran the sed command, but the answer you posted below makes the file be edited in-place.
Feb
19
answered How can sed find pattern in one field but append another(same row)
Feb
19
answered how can sed get patterns from a file
Jan
28
comment Is it safe to store critical passwords in server environment variables?
I'd skip #1. If the system is running, the filesystem is mounted and unencrypted. If it's not running, your physical access control should be adequate. If it needs rebooted, you either need someone to provide the decryption key on every boot (which is annoying), or you need to have the machine provide that - in which case the credentials are usually also available to anyone with access to the hard drive. Most "server" machines typically don't use disk encryption because of that trade-off cost. :)
Jan
28
answered Is it safe to store critical passwords in server environment variables?
Sep
12
comment How to make new file permission inherit from the parent directory?
The setgid bit only makes created files inherit the group /if/ the person creating the new file is a member of that group; if the creating user is the owner but not a member of the group, or the directory is world-writable, the setgid bit won't do anything. And the umask for all file-creating users still needs to be set to allow appropriate group access.
Jul
11
answered Detect long-running commands and notify when they complete
Jun
28
answered Help installing postgres in ubuntu