Reputation
Next tag badge:
98/100 score
38/20 answers
Badges
20 153 309
Newest
 Enlightened
Impact
~5.1m people reached

Aug
5
comment How to remove line break if line character count less than n chars
And if after concatenation, the line is still less than x chars, do you want to concatenate the next line again?
Aug
4
comment Grep all at once
@mikeserv, the empty string is found in every string, that's why including the empty string in the list of searches will match every line. Not sure it's worth mentioning here.
Aug
4
answered Grep all at once
Aug
4
revised How do I create a directory for every file in a parent directory
missing quotes and &&
Aug
4
revised How do I create a directory for every file in a parent directory
nothing bash specific in here. Missing &&.
Aug
4
comment Why is printf better than echo?
As a note, the one (and maybe only) advantage of having echo expand the \x sequences as opposed to the shell as part of the quoting syntax is that you can then output a NUL byte (another arguably mis-design of Unix is those null-delimited strings, where half the system calls (like execve()) can't take arbitrary sequences of bytes)
Aug
4
revised Redirecting the content of a file to the command “echo”
added 430 characters in body
Aug
4
comment Terminal - redirection of output to file is cutted
Would strace -fe process -o strace.log cpp-generator > log.log suggest that the process is killed (look in strace.log)?
Aug
4
comment Terminal - redirection of output to file is cutted
Is it truncating if you run it as stdbuf -o0 cpp-generator > log.log
Aug
4
answered Limit line output rate in XTerm?
Aug
4
comment Terminal - redirection of output to file is cutted
Is it possible that cpp-generator or any of the log-generating process it spawns be killed or call abort(), or _exit() without getting a chance to flush its stdio buffers? (when the output goes to a terminal, the buffering is line-based instead of block-based which would explain the difference)
Aug
4
awarded  Enlightened
Aug
4
awarded  Nice Answer
Aug
4
comment Terminal - redirection of output to file is cutted
Is there a mention of /dev/fd or /dev/std* or /proc/self/fd in cpp-generator. Is the file also truncated if you use ./cpp-generator | cat > ~/log.log or ./cpp-generator >> ~/log.log?
Aug
4
comment How to delete every second line from a file?
Note that the last two are convoluted ways to write grep Data and grep -v 'No error'
Aug
4
comment How to add a password to a BASH script
@AlaaAli, yes, though if in the case of a script, that won't go in a shell history file.
Aug
3
revised Using awk to store a binary number in text file as string and then convert to hexadecimal
make `t`, `a`, `c` local to the function.
Aug
3
answered How to alias part of expression for find?
Aug
3
comment How to alias part of expression for find?
"${@:2}" is ksh syntax also supported by bash and zsh. Portably, you'd do file=$1; shift; command find "$file" .... "$@"
Aug
3
comment How to alias part of expression for find?
Note that it means that you can no longer do find dir1 dir2 -name...