2,913 reputation
1412
bio website
location
age
visits member for 2 years, 1 month
seen 11 hours ago
stats profile views 55

May
2
comment How to find out UUID of a non-block USB device?
@krokoziabla yes I believe they are assigned by virtualbox. My iPod gets a different UUID every time.
May
2
comment Is there a postexec/predisplay hook for ZSH?
zsh cannot tell if there is going to be output because in order to do so it would have to give the command a pipe instead of the tty which would interfere with interactive programs.
May
2
comment /usr/bin/env: zsh -: No such file or directory
@slm sure - SUS stands for "single unix specification", the old name for the Open Group Base Specification that I linked in my answer.
May
2
answered /usr/bin/env: zsh -: No such file or directory
May
2
comment /usr/bin/env: zsh -: No such file or directory
The 'guideline' "To make scripts portable, use #!/usr/bin/env <cmd ...> rather than #!/path/to/cmd <...>." is bad advice. The correct solution to portability is to modify the scripts to contain the correct path (/bin/zsh, /usr/bin/zsh, /usr/local/bin/zsh) at installation time, and there is example code as part of the SUS standard for how to do this.
Apr
19
comment 'ps' command hangs
those TTY=? outputs are suspicious, particularly since these look like commands that are clearly actually on a tty. It's possibly looping through something trying to find the tty and then giving up.
Apr
19
comment How can I hook functionality to the “go to line”-command in Vim?
You can actually just use 175zz.
Apr
19
comment How to determine which module taints the kernel?
G is always printed when P isn't, it doesn't necessarily imply an external module (though the O flag does).
Apr
10
comment open() console for default file descriptors
It's not closing "all file descriptors but 0, 1, and 2", it's closing a single extra file descriptor to the console that it just opened. It doesn't close anything that was already open before the loop executed.
Apr
4
awarded  Yearling
Apr
1
comment Mapping intr to del key
@JamesA See my edit.
Apr
1
revised Mapping intr to del key
added 140 characters in body
Apr
1
answered Mapping intr to del key
Mar
27
comment Key letters? Option letters? What are these things?
The tar example is different because it groups all of the options together, whereas the conventional style does not allow options that have arguments to be grouped together. You couldn't do foo -hxgczf 10 12 in place of foo -h -x 10 -g -c -z 12 -f - that's something only tar does (well, i think there are a handful of other programs that do it too)
Mar
25
comment How to forbid the execution of /bin/rm -f *?
If you find yourself getting into the habit of working around your alias, then your alias is too intrusive and should be replaced with one that's still safe, but less annoying. What exactly is your "alias of mv"?
Mar
22
comment How to change Vim's command type mode programmatically?
Right but then I don't have it in the command line if I want to modify it for subsequent :s's - I'd be locked into doing / again then :s//... again, and can't see my capture groups in front of me.
Mar
22
comment How to change Vim's command type mode programmatically?
I very often want to use the incremental hilighting to get feedback while building a regular expression for a :s command (or, conversely, go back to / to get the benefit of incremental hilighting to figure out where I screwed up my regex)
Mar
21
comment Read only mode in gdb
Wait. Back up. Did you say "attaching a debugger to the production server"?
Mar
19
awarded  Nice Answer
Mar
16
comment What are guarantees for concurrent writes into a named pipe?
PIPE_BUF is, by the way, guaranteed to be at least 512. Note that you also have to guarantee that your process actually writes each line to it in a single write call. Enabling line buffering (setvbuf(stdout, NULL, _IOLBF,512)) will do this without requiring you to use low-level functions.