Reputation
Next tag badge:
972/1000 score
232/200 answers
Badges
13 128 265
Impact
~3.6m people reached

Apr
2
revised How can a background process know its own PID?
rollback title to preserve original meaning
Apr
2
revised How can I find the program I'm hiding in bash
added 98 characters in body
Apr
2
answered How can I find the program I'm hiding in bash
Apr
2
comment How to replace a word with new line
$1=$1 condenses sequences of blanks into one space character and returns false if the first field is 0. Doesn't make sense. You probably want awk 1 RS='\\|END\\|' or awk NF RS='\\|END\\|' or awk length RS='\\|END\\|' here. Note that a regexp RS requires gawk or mawk
Apr
2
revised How to make sure the $var variable in expanded in “$varsomething”?
deleted 99 characters in body; edited title
Apr
2
revised How to make sure the $var variable in expanded in “$varsomething”?
missing quotes
Apr
2
answered How can a background process know its own PID?
Apr
2
comment How to tell xargs which argument to choose ?
unix.stackexchange.com/questions/90886/…
Apr
2
comment How to replace a word with new line
That's the standard syntax. Using \n as in @A.B.'s answer wouldn't work with some sed implementations.
Apr
2
comment How to cat two heredocs?
To add to the list: ... >(command) (process substitution, command's stdin is a pipe, expands to the other end as a file name), coproc command/command |& (coproc), zpty C command (coproc with pty).
Apr
2
revised How to cat two heredocs?
added 431 characters in body
Apr
2
answered How to cat two heredocs?
Apr
2
comment Unix Shell : Array assignment not working
You want to run the [ command, not the [0 command.
Apr
2
comment How to get new created (not change or modified), & removed files in last 24 hours
Oops, sorry, he did mention Linux indeed. And birth time was not available in ext3 IIRC. My bad.
Apr
2
comment How to get new created (not change or modified), & removed files in last 24 hours
On Linux, the creation date (whatever that means) is stored on most modern native file systems, but (with the possible exception of some Suse based systems), there's no kernel API to retrieve it so those %w of GNU stat won't work.
Apr
2
comment How to get new created (not change or modified), & removed files in last 24 hours
The OP didn't mention Linux (though he referred to GNU stat). FreeBSD/OS/X find have -Bmin, -Btime, -Bnewer to act on birth time.
Apr
1
revised Is there a way to grep a folder and show all lines containing non-ascii characters?
typo
Apr
1
revised Is there a way to grep a folder and show all lines containing non-ascii characters?
typo
Apr
1
comment What does the “-y” do in “yum -y groupinstall gnome”?
Ever heard of the man command? It can come handy at times.
Apr
1
comment How to conditionally do something if a command succeeded or failed
That works but is convoluted. You're running ping in a subshell of a subshell, the output of ping is captured in view of running it as a command. But because the output is redirected to /dev/null that will always be the empty string. So you're running nothing in a subshell, which means the previous exit status (of the command substitution subshell, that is of ping) will be retained. Obviously, the correct way is if ping ...; then here.