Reputation
122,815
Next tag badge:
98/100 score
38/20 answers
Badges
20 153 311
Newest
 Nice Answer
Impact
~5.1m people reached

Aug
10
comment Where buitin variables are stored in bash?
You didn't look very hard, did you? A grep -r BASH_VERSION points directly to variables.c.
Aug
10
revised awk does not end
added 278 characters in body
Aug
10
comment How do I limit dnsmasq listening to only one interface?
The man page is pretty clear about it. And it is interfaces plural as you can do --bind-interface -i lo -i br1... to bind on the addresses on lo and br1. See also --bind-dynamic.
Aug
10
comment How do I limit dnsmasq listening to only one interface?
Add --bind-interfaces
Aug
10
comment determine shell in script during runtime
@iconoclast, so it correctly identifies bash 3.2.53(1)-release as the interpreter interpreting it.
Aug
9
comment Process which locks up, ignores SIGKILL, is runnable (not a zombie or in uninterruptable sleep). What state is it in?
What does /proc/<pid>/stack (and /proc/<pid>/task/*/stack) contain? Has that process got several threads?
Aug
9
comment determine shell in script during runtime
@iconoclast, you mean you ran zsh ./that-script and it returned bash 3.2.53(1)-release? More likely you ran it as ./that-script from within zsh which got it interpreted by your sh, and your sh happens to be bash.
Aug
9
comment Loop through * files using $1 in bash script
It doesn't work properly in some versions of the Bourne shell when $# is 0. It doesn't work with the Bourne shell or pdksh when $IFS is empty (doesn't contain space for the Bourne shell).
Aug
9
revised A variable in Bash that contains quotation marks and spaces
added 2 characters in body
Aug
9
revised A variable in Bash that contains quotation marks and spaces
You wouldn't want to have $MV_PARAMS split+globbed here.
Aug
9
comment Loop through * files using $1 in bash script
Note that the canonical (and most portable) way to write for file in "$@" is for file do.
Aug
9
revised Loop through * files using $1 in bash script
added 40 characters in body
Aug
9
answered awk does not end
Aug
9
comment awk does not end
Note that by writing: print $2, "\t", $5 as opposed to print $2 "\t" $5, you're writing the 2nd field followed by OFS (space), TAB, OFS and the 5th field.
Aug
9
revised awk does not end
formatting. Nothing to do with Linux specifically
Aug
7
comment Removing gedit without removing all of cinnamon-desktop-environment
It depends on iceweasel | firefox | chromium | gnome-www-browser, so as long as one of them is installed, the dependency is not broken.
Aug
7
comment Turn off buffering in pipe
I'd use socat -u exec:long_running_command,pty,end-close - here
Aug
7
comment Turn off buffering in pipe
That's because |& is short for 2>&1 |, literally. So cmd1 |& cmd2 is cmd1 1>&2 2>&1 | cmd2. So, both fd 1 and 2 end up connected to the original stderr, and nothing is left writing to the pipe. (s/outer stdout/outer stderr/g in my previous comment).
Aug
7
comment Turn off buffering in pipe
OK, what's happening is that with both zsh (where |& comes from adapted from csh) and bash, when you do cmd1 >&2 |& cmd2, both fd 1 and 2 are connected to the outer stdout. So it works at preventing buffering when that outer stdout is a terminal, but only because the output doesn't go through the pipe (so print_progress prints nothing). So it's the same as long_running_command & print_progress (except that print_progress stdin is a pipe that has no writer). You can verify with ls -l /proc/self/fd >&2 |& cat compared to ls -l /proc/self/fd |& cat.
Aug
7
comment Why does grep goes into blocking stage?
You need all the processes that don't write to the pipe to close(fds[1]). You forgot one.