Reputation
24,649
Next tag badge:
72/100 score
23/20 answers
Badges
27 52
Newest
 Nice Answer
Impact
~1.1m people reached

18h
comment $@ except the 1st argument
An alternate (and ugly) bash possibility: indirect variables: for ((i=2; i<=$#; i++)); do something with "${!i}"; done
1d
comment How to print a concatenation of strings in Korn Shell
It looks better to get read to show the prompt: read dirname?"Enter the directory name: "
1d
comment How to print a concatenation of strings in Korn Shell
And when you call read with no variable, the user's data is stored in the $REPLY variable: to demonstrate: read; echo "$REPLY"
2d
awarded  Nice Answer
Aug
25
answered Loop ignores change of variable from a subshell in the background
Aug
24
comment Request a second available IP from the DHCP server?
Duplicate of stackoverflow.com/q/32191248/7552
Aug
20
comment For loop formatting
In the numeric loop, use (( i=0; i < ${#hemi[@]}; i++ )) -- better yet, remove the first part of your answer and keep the superior simple version
Aug
19
revised Merging columns in a file using Awk
added 657 characters in body
Aug
19
answered Merging columns in a file using Awk
Aug
19
comment Merging columns in a file using Awk
It's safer to use printf "\n%s", $0 -- in case the input line contains % characters.
Aug
19
comment Shell script error (: not found [No such file or directory])
high probability that the script file contains \r\n line endings.
Aug
18
comment bash error: Missing '))'
@sardar, please read unix.stackexchange.com/help/someone-answers
Aug
17
comment How can I delete a file named “--append”?
The other approach is rm ./--append
Aug
17
comment Grab the last executed command from history as a string and store in variable in bash
Well, why are you trying to re-implement bash's history mechanism?
Aug
17
answered Grab the last executed command from history as a string and store in variable in bash
Aug
17
comment Pass BASH array to diff like file contents
@Fiximan, your tr pipeline will break for any array element containing spaces. printf is the idiomatic way to print an array one element per line.
Aug
14
comment Awkward awk exit code
"test.sh" is a strange name for an awk program. Are you sure that "test.sh" contains that awk code? It's not obvious from your question. I question this because "works for me".
Aug
14
comment Using the built-in “time” command in bash rather than the external command
watch 'bash -c "builtin time ls"' perhaps?
Aug
14
comment Log monitoring using shell script
@YRVK, please read unix.stackexchange.com/help/someone-answers
Aug
14
awarded  Nice Answer