Reputation
21,930
Next tag badge:
856/400 score
77/80 answers
Badges
3 49 79
Newest
 Good Answer
Impact
~879k people reached

May
19
comment How to escape correctly this word on vim?
To figure out what should or should not be escaped, read the vim documentation on the magic option: :help 'magic'.
May
15
comment How to properly use awk in ksh?
What you have here is a frankenscript with awk and shell parts mashed together. You need awk to run awk scripts. ksh doesn't understand awk scripts and isn't smart enough to run awk unless you tell it to. Also you missed a " after STOP in your script.
May
15
comment Script to read line by line from a file pipe that to another command and output to another file
You have a space between $ and line. If that typo is in your script as well all you are doing is hashing the text $ line over and over.
May
13
comment How can I list every port serving a web page
@John I am aware of nmap's default behavior which is why I commented about the -sV option that causes nmap to switch from its default database of "well known" port numbers to a more intrusive identification algorithm, where it will actually send GET requests to the port in question. I just tested it on my machine and it was able to successfully identify a http service on port 23. Without -sV it went back to labelling it as telnet.
May
13
comment How can I list every port serving a web page
One could also try nmapping the server with the service detection option enabled (-sV) and then inspecting / parsing the output for http. I don't know how robust or accurate nmap's service detection algorithms are but nmap itself is well-regarded.
May
13
comment compare two files and fetch data
First, the file order should be FileB FileA according to your script, right? Second, I think the desired fields are 10 and 11 not 7 and 8. Perhaps OP could clarify whether or not $12 should be included as well.
May
13
comment compare two files and fetch data
Please add to your question the desired output for the two example files you have above, so we know what format you want the output to look like. Do you want a separate file for each "id"?
Feb
24
comment How do you derive a decimal from a math operation involving a variable?
bash only does integer math. Just use awk and be done in one line: awk '{sum += $4} END {print 10^5/sum}' $f
Feb
24
comment Ubuntu installaion doesn't ask for boot loader
What version of Ubuntu and which install method / image did you use? What options did you choose during the install? If the system installed and boots successfully it's not really a problem, is it?
Feb
24
comment the timezone format in /etc/timezone of debian7
UTC is not a location, so it is a special case and goes into Etc.
Feb
10
comment Write bash function which operates on list of filenames
I don't think that is proper scp syntax. You can't do user@host:"file list" as far as I am aware. You need to repeat user@host for each file.
Jan
31
comment What does . ~/.bashrc command do?
pubs.opengroup.org/onlinepubs/9699919799/utilities/…
Jan
27
comment Run another command before running the command the user wants to run
@IonicăBizău The reason there is no infinite recursion is given in the bash manual: The first word of the replacement text is tested for aliases, but a word that is identical to an alias being expanded is not expanded a second time. This means that one may alias ls to "ls -F", for instance, and Bash does not try to recursively expand the replacement text
Jan
23
comment Increment Numbers in URL?
What are you really trying to do? If you just want to print a list with bash: for i in {192..302}; do echo "http://sample.com/poilus/cwrgshs/$i/$i.html"; done. I smell an XY problem though.
Jan
23
comment In a Bash if condition, how to check whether any files matching a simple wildcard expression exist?
Your answer is different from @ChrisDown's because you parse ls output whereas he does not (he only checks its exit status). Due to the complexities involved with parsing ls output, the fact that ChrisDown avoids it entirely makes his answer more robust and correct than yours, even if yours will work in the many cases where "reasonable" file names (i.e. not containing whitespace) are concerned.
Jan
14
comment Vim colors conflicting with terminal ones
As vim runs in a 256 color terminal it will be limited to the 256 colors the terminal uses, and there is no full RGB terminal I am aware of so @al92's suggestion is unlikely to be possible. The closest you can get is to come up with a scripted command to change terminal colors and arrange to have it run every time you open and close vim to set and reset the terminal colors.
Jan
8
comment Bash: kill background jobs
@fersarr Here you go
Dec
27
comment How do I get the old `du` behaviour back?
Have you considered du -c?
Dec
19
comment sudo - ubuntu 12.04
Are you sure you aren't in the sudo or admin group? Maybe there is something in /etc/sudoers.d?
Dec
17
comment awk manipulation of file
@user3138373 It's just a tab to separate gene and coord into separate columns.