695 reputation
1513
bio website
location
age 34
visits member for 3 years, 8 months
seen Oct 8 at 18:00

mmmm, coffee


Sep
28
awarded  Famous Question
Sep
8
comment Go up one level from a nonexistent path
Great answer (I came to post basically the same thing), but it will loop forever if there is no '/' in $dir and $dir isn't a directory.
Apr
26
revised line 7: [: echo: integer expression expected
indent code so it will look better
Apr
26
comment line 7: [: echo: integer expression expected
@JonathanLee if something doesn't work, you can try the commands in your terminal one-by-one to see what's happening. So type x='echo test|wc -m' then type echo $x to see what value 'x' got.
Apr
26
suggested suggested edit on line 7: [: echo: integer expression expected
Apr
23
awarded  Good Question
Mar
19
comment Why is iterating over a file twice faster than reading it into memory and computing twice?
I tried something similar with a 300k-line, 30MB file. According to time, it took .086s to tail -n 1000000 stdout.log > /dev/null, but after reading it into the log variable like you did, it took 3.617s to echo $log > dev/null. Maybe you could simplify your question? (PS instead of grep | wc maybe you could use grep -c)
Mar
13
comment How to access my linux user account from different computer?
And if your computer is running Windows instead of Linux, you can use a program like Putty to ssh to the remote computer.
Mar
12
answered How to listen to a specific port and return 200 status
Mar
12
comment What keys are generated during Debian 7.4 (Wheezy) installation?
This answer on security.stackexchange (as well as the comments on the accepted answer) might help you.
Mar
12
comment What keys are generated during Debian 7.4 (Wheezy) installation?
Is there a reason you trust the Debian team to install packages on your system (Debian has root on your system, as Shuttleworth famously said about Canonical), but you don't trust them to do the right thing when generating keys? Maybe you can share more about what you're trying to accomplish (this sounds suspiciously like an X-Y Problem)‌​?
Feb
21
comment How can I append multiple extensions to a string with sed?
@muser x=1; while [[ $x -lt 10 ]]; do x=$((x+1)); echo $x; if [[ $x -gt 3 ]]; then break; fi; done. In your case, you would probably try fetching the file inside the loop; if you get a good file, then break instead of trying the rest of the extensions (since they would probably fail, anyway).
Feb
20
revised Why does bash have a HISTCONTROL=ignorespace option?
added detail. Maybe I've explained it better, now?
Feb
20
answered How can I append multiple extensions to a string with sed?
Feb
20
answered Filesystem surprisingly large
Feb
20
answered Why does bash have a HISTCONTROL=ignorespace option?
Feb
6
comment Allow user1 to “su - user2” without password
Do you have to use su, or is ssh martin-test@localhost okay (using a keypair or maybe .shosts for password-less authentication)?
Feb
3
awarded  Yearling
Jan
3
comment How to parse ISO8601 dates with linux date command
I get the same results but if I use the long form (e.g. 2014-01-03T14:22; use an output format like +%FT%T) I get the expected result.
Dec
11
comment I need Control loop help -
${lostsongs[a+1]} will read past the end of the array on the last loop (which is why you see [[ '' < store ]] in your debug output, where you are apparently running with size of 1). You also need spaces around the < size in the if statement; right now it's testing if "a<1334" exists (i.e. is not null, and it isn't) instead of testing if "a < 1334" (which is an invalid test, of a string against a number). Can you share more about what is stored in $lostsongs? I think that is part of the problem.