83,868 reputation
1092199
bio website
location European Union
age
visits member for 2 years
seen 9 hours ago

Aug
27
comment Bash -c with positional parameters
Careful with the analogy with argv[0]. $0 is only set to the argv[0] passed to execve() when it's like sh or bash. For scripts, $0 is set to the path given as argument 1, 2... to the interpreter (and for scripts executed directly, that comes from the first path argument to execve()).
Aug
27
comment Bash -c with positional parameters
@muru, which is correct (and you probably don't have txt files in the current directory). See also bash -c 'echo "${1?}"' foo
Aug
27
answered Bash -c with positional parameters
Aug
27
revised Remove duplicate fields in a given column
added 83 characters in body
Aug
27
revised What are the responsibilities of each Pseudo-Terminal (PTY) component (software, master side, slave side)?
typos, formatting
Aug
27
revised is there a way to escape a process in bash with out quitting it?
you can attach a debugger to the process to redirect the output somewhere else.
Aug
27
awarded  filesystems
Aug
27
awarded  Nice Answer
Aug
26
awarded  Good Answer
Aug
26
revised How can you get the current terminal line (the one that is still editable by the user)?
edited tags
Aug
26
comment How can you get the current terminal line (the one that is still editable by the user)?
Try info zsh (you may need to install a zsh-doc package), press i to bring up the index, enter BUFFER (completion available with Tab). Or info -f zsh -n 'Zle Widgets'. See also man zshzle though I wouldn't use man for such a big manual. See also the user guide on the zsh website
Aug
26
comment How can you get the current terminal line (the one that is still editable by the user)?
In zle widgets, it's in $BUFFER. See also $LBUFFER and $CURSOR. Those can also be assigned to. You may want to have a look at the documentation and example widgets.
Aug
26
revised sed load substitute from file
added 273 characters in body
Aug
26
comment Restarting a service from a script
would your kill by process name (it's better to combine that with pid files to avoid problems or use cgroups as systemd) not possibly kill your script?
Aug
26
comment Restarting a service from a script
How is the "stop" action done? Does it help if you add a trap '' TERM in your restart script?
Aug
26
comment Restarting a service from a script
What's the OS, init system (upstart, systemd, sysvinit...)?
Aug
26
revised Sort the 'last' output by month
added 234 characters in body
Aug
26
comment Sort the 'last' output by month
@DimitreRadoulov, indeed, it's even in HP/UX, so it's probably not a GNU extension as I thought it was. I've changed the wording.
Aug
26
revised Sort the 'last' output by month
added 63 characters in body
Aug
26
awarded  Yearling