20,880 reputation
34677
bio website
location United States
age
visits member for 3 years, 4 months
seen 2 hours ago

Debian user, GNU/Linux enthusiast, FLOSS supporter, hobby developer.


1d
reviewed Close How to list filenames within a folder based on a pattern supplied?
1d
reviewed Close Bash script spawns many new processes of itself
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
awarded  Good Answer
Dec
17
comment awk manipulation of file
@user3138373 It's just a tab to separate gene and coord into separate columns.
Dec
17
answered awk manipulation of file
Dec
16
comment awk array using number as value did not work
@Karli Update your question. You said you corrected your code so update your question and then provide more information about the problem.
Dec
16
comment awk array using number as value did not work
If the reference file is missing a column in some rows then your reference file is broken and you should fix the file. Go type in a 0 for every missing number.
Dec
16
comment awk array using number as value did not work
Your awk code does not match your English description. According to your English description of your desired output, you should have if ($1 in a) $2 = a[$1]; print and for the second part if ($1 in b) $3 = b[$1] + $3 - 1; $4 = b[$1] + $4 - 1; print.
Dec
15
answered cUrl : Argument list too long
Dec
13
reviewed Reopen When building a new kernel in OpenBSD 5.6, can the name of `config` be something else?
Dec
12
comment How can I run a command in bash after any change in $PWD?
Commands external to the shell can never change the shell's working directory so you won't have to worry about those, only built-ins.
Dec
11
comment Gmail blocking mutt
Do you have 2-factor authentication turned on in gmail? If so mutt won't be able to log in that way. You'll have to generate an application key for mutt to use to log in instead.
Dec
11
comment Storing longer text output in memory in shell variables vs Writing to disk
@CuneyitKiris That is an interesting link and quite a long one. Would you care to elaborate as to why you want me to look at it? Like I said, your answer not really address the question at all. There is nothing to put in the environment or argument list here. I don't see how your suggestion of "write a C program that writes data" is relevant or helpful.
Dec
11
comment Storing longer text output in memory in shell variables vs Writing to disk
@dbza Since you have edited your question to show the entire loop, I would recommend moving >>log_file.txt outside the loop, so you have done<infile >>log_file.txt as the last line instead. That way you keep the file open and avoid reopening and reclosing it each iteration. If you want to try anything more complicated though, you should first take measurements to see if disk I/O is really taking enough time to be worth optimizing. You can probably do this by replacing >>log_file.txt with >/dev/null to get rid of disk I/O altogether and see how much of a speed-up you get.
Dec
11
comment Storing longer text output in memory in shell variables vs Writing to disk
@mikeserv I'm sorry, that is not the case. You can see this yourself: foo='not in the environment'; envfoo='in the environment'; export envfoo; env | grep foo= and see what you can get. Only the exported variable is shown. I've looked at your links and nothing in them contradicts this.
Dec
11
comment Storing longer text output in memory in shell variables vs Writing to disk
@mikeserv A single 8MB env var - and this is where you keep getting stuck. Who said anything about environment variables? Where in the question do you see OP trying to put this variable into the environment? Need I remind you of the difference between an unexported shell variable and an environment variable?
Dec
11
comment Storing longer text output in memory in shell variables vs Writing to disk
@mikeserv db2 appears to be some sort of IBM database command line utility. It is highly unlikely that nl does anything close to what it does.
Dec
11
comment Storing longer text output in memory in shell variables vs Writing to disk
@mikeserv Well obviously everything stops working if you exhaust the memory in the machine. That's why I was making the assumption that wouldn't happen. It is only about 10 MB (100k iterations * 100 chars) of data after all and everyone has 10 MB nowadays. The problem isn't running out of memory. And as I explained, you don't need to put this 10 MB shell variable in any argument lists or environments. So what exactly do you think you are running out of? We aren't passing this 10 MB shell variable to db2 if that is what you are thinking because the question doesn't say that at all.
Dec
11
comment Storing longer text output in memory in shell variables vs Writing to disk
By my understanding of the question, this "answer" is mostly off-topic and irrelevant. The first sentence gives a rough "probable" answer which I already mentioned in a comment, and the rest of it proceeds to veer off-topic into explaining why a dumb command that nobody would want to run anyways may not work.