From c8c60d0a1a3852265a19ff63c15ba0236704b1b4 Mon Sep 17 00:00:00 2001 From: skyper <5938498+SkyperTHC@users.noreply.github.com> Date: Sun, 1 Sep 2024 18:34:59 +0100 Subject: [PATCH] Update README.md --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2fa3dc2..2653643 100644 --- a/README.md +++ b/README.md @@ -1195,10 +1195,9 @@ Using Python, download only: ```sh # Declare a curl-alternative purl() { - local p - local url="${1:?}" - { [[ "${url:0:8}" == "https://" ]] || [[ "${url:0:7}" == "http://" ]]; } || url="https://${url}" - "$(which python3 || which python || which pyton2 || which false)" -c "\ + local url="${1:?}" + { [[ "${url:0:8}" == "https://" ]] || [[ "${url:0:7}" == "http://" ]]; } || url="https://${url}" + "$(which python3 || which python || which pyton2 || which false)" -c "\ import urllib.request import sys import ssl @@ -1234,6 +1233,18 @@ surl() { # surl ipinfo.io ``` +using Perl, download only: +```sh +lurl() { + local url="${1:?}" + { [[ "${url:0:8}" == "https://" ]] || [[ "${url:0:7}" == "http://" ]]; } || url="https://${url}" + perl -e 'use LWP::Simple qw(get); +my $url = '"'${1:?}'"'; +print(get $url);' +} +# lurl ipinfo.io +``` + Using bash, download only: ```sh burl() {