in reply to •Re: Listing URLs to stdout
in thread Listing URLs to stdout

Golf:

perl -pe's/^URL=|.*//s' *.url

Unix golf:

sed 's/^URL=//;t;d' *.url

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^3: Listing URLs to stdout
by hsmyers (Canon) on Jan 13, 2005 at 15:37 UTC
    You perhaps missed the handicap of playing on greens designed in Redmond WA? The above sadly produces an error message: "'.*' is not recognized as an internal or external command, operable program or batch file."

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."

      You have to use the double quotes around the script on windows.

      /J\

        And if you do then you get:
        C:>perl -pe"s/^URL=|.*//s" *.url Can't open *.url: Invalid argument.
        More to the point the real error is in assuming that the command line processor in windows will expand wild cards, it of course won't---that trick is a unix thing, useful, but unix...

        --hsm

        "Never try to teach a pig to sing...it wastes your time and it annoys the pig."