From e59aa5903e25b6f74a641463922dcc2b07d5dd13 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 11 Jul 2001 10:15:32 +0000 Subject: [PATCH] Last Perl version. --- imgsizer | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/imgsizer b/imgsizer index 12677a3..c41b998 100755 --- a/imgsizer +++ b/imgsizer @@ -87,8 +87,16 @@ Options: EOT # Anything that can fetch a URL defined on the command line -# and dump it to stdout will do here. -$fetcher = 'httpget'; +# and dump it to stdout will do here. We try a number of +# alternatives and crap out if we can't find any of them +%fetchers = {"curl":"curl", "httpget":"httpget", "lynx":"lynx -source"} +$fetcher = "" +for $trythis in keys(fetchers) { + if (system(`whereis $trythis >/dev/null`) == 0) { + $fetcher = $fetchers{trythis} + } +unless ($fetcher) + die("Can't find a remote URL fetcher.\n") # Output uppercase tags, surrounded by quotes, by default. $lower = 0; -- 2.43.0