News for hackers. Stuff that matters.
Re:“This project will only take 2 hours” by dugmartin on Wednesday November 10, 2021 @09:47AM (#29175144)
Isn't the >> going to cause urls.txt to grow geometrically?

eg, copying http://example.com/foo and then http://example.com/bar and then http://example.com/baz I think urls.txt would look like:

    http://example.com/foo
    http://example.com/foo
    http://example.com/bar
    http://example.com/foo
    http://example.com/bar
    http://example.com/baz
EDIT: I stand corrected. I should have run the code instead of mentally executing it.

One issue I did find when I ran it. The shebang should be:

    #!/bin/bash
as [[ is a bash built-in. I'm on Ubuntu - maybe this works on Mac as /bin/sh is an alias to /bin/bash?
Re:“This project will only take 2 hours” by ktpsns on Wednesday November 10, 2021 @10:07AM (#29175362)
Re:“This project will only take 2 hours” by BenjiWiebe on Wednesday November 10, 2021 @10:04AM (#29175330)
Doesn't look like it. The URLS variable could more appropriately be named CURRENT_URL. Singular, not plural.
Re:“This project will only take 2 hours” by stevelosh on Wednesday November 10, 2021 @10:25AM (#29175602)
The user might copy a block of text with multiple URLs, all of which get pulled out by the grep.