485 reputation
38
bio website
location
age
visits member for 3 years, 6 months
seen Dec 10 at 17:29

Dec
10
comment how to write a udev rule to remove a tag?
udev supports removing tags via TAG-="foo" as of v217, which was released 2014-10-27. (commit, changelog entry)
Nov
22
accepted Get bash DEBUG trap to execute only once for and/or lists?
Sep
19
accepted how to write a udev rule to remove a tag?
Sep
19
comment how to write a udev rule to remove a tag?
Look what I just found: thread.gmane.org/gmane.comp.sysutils.systemd.devel/22841
Sep
19
comment how to write a udev rule to remove a tag?
Thank you, I was unaware of last_rule. This works only if my rule is evaluated before the TAG+="uaccess" rule. I think I can guarantee this ordering if my rules filename is lexically sorted before 70-uaccess.rules, right? (e.g., name it /etc/udev/rules.d/69-uaccess-preempt.rules)
Sep
19
asked how to write a udev rule to remove a tag?
Jun
30
awarded  Yearling
Apr
17
comment Get bash DEBUG trap to execute only once for and/or lists?
@StephaneChazelas: Thanks for the link. It looks like preexec.bash basically does what I do in my answer (via the preexec_interactive_mode variable), so maybe the approach in my answer is as non-kludgy as it can get. I do wish bash had something like zsh's preexec() hook.
Apr
17
answered Get bash DEBUG trap to execute only once for and/or lists?
Apr
17
asked Get bash DEBUG trap to execute only once for and/or lists?
Apr
14
awarded  Notable Question
Jan
8
comment Shell filename pattern that expands to dot files but not to `..`?
There's a bug in your answer: The "A more complex variant" will pass *, .[!.]*, and/or ..?* to somecommand if those patterns don't match any file. I think you should replace case $x in .|..) continue;; esac with [ -e "$x" ] || continue (like your third bullet point).
Jan
8
comment Using while loop to ssh to multiple servers
The -u option is not supported by POSIX, and thus should not be used for #!/bin/sh scripts; use read HOST <&10 instead. Also, POSIX only requires shells to support file descriptors 0 through 9, so 10<servers.txt can't be used if the script is to be strictly conforming.
Jan
8
comment Using while loop to ssh to multiple servers
Another alternative: exec 3<&0; while read HOST; do ssh $HOST "uname -a" <&3; done <servers.txt; exec 3<&- This makes file descriptor 3 a backup of the original stdin, then uses it for ssh's stdin, then closes the backup FD when done. This works on any POSIX-compatible shell.
Aug
5
revised Why not use “which”? What to use then?
add section headings to make it easier to skim the answer; add a tl;dr section at the top for people who just want to know the answer
Aug
5
suggested approved edit on Why not use “which”? What to use then?
Jun
29
answered Preventing propagation of SIGINT to Parent Process
Jun
29
comment Preventing propagation of SIGINT to Parent Process
+1 for the clever idea, although beware that the shell's behavior changes when it is an interactive shell (at least the POSIX shell does; I'm not familiar with the details of ksh). Examples: ${ENV} is sourced, the shell won't immediately exit when it encounters an error, SIGQUIT and SIGTERM are ignored.
Jan
23
comment Redirect all subsequent commands' stderr using exec
@StephaneChazelas: You make a good point. I just wanted to point out that the syntax is not supported by the POSIX standard and thus won't universally work in /bin/sh scripts (many people erroneously use bash syntax in /bin/sh scripts).
Jan
21
awarded  Commentator