From mboxrd@z Thu Jan 1 00:00:00 1970 From: steffen at sdaoden.eu (Steffen Nurpmeso) Date: Thu, 26 Nov 2020 22:56:53 +0100 Subject: [TUHS] Seeking wisdom from Unix Greybeards In-Reply-To: <7DBB40AE-259D-494E-8ABF-2FE4D47F4052@iitbombay.org> References: <20201126183746.DD93218C087@mercury.lcs.mit.edu> <7DBB40AE-259D-494E-8ABF-2FE4D47F4052@iitbombay.org> Message-ID: <20201126215653.INoK4%steffen@sdaoden.eu> Bakul Shah wrote in <7DBB40AE-259D-494E-8ABF-2FE4D47F4052 at iitbombay.org>: |RFC734 Interesting! Off-topic, but i have downloaded this via #!/bin/sh - FROM=https://www.rfc-editor.org/rfc/ #FROM=https://tools.ietf.org/rfc/ MYDIR=/x/doc/coding/rfc : ${WGET:=`command -v curl` --silent} #: ${WGET:=`command -v wget` -q -O -} ## cd "${MYDIR}" || { echo >&2 'Cannot cd to '"${MYDIR}" exit 21 } xfiles= estat=0 while [ ${#} -gt 0 ]; do RFC=${1} shift [ -f "rfc${RFC}.txt" ] && { echo 'RFC '${RFC}': a local copy of this RFC yet exists' continue } printf 'Fetching RFC %s.txt ... ' "${RFC}" if ${WGET} "${FROM}"rfc${RFC}.txt > rfc${RFC}.txt; then xfiles="${xfiles} rfc${RFC}.txt" printf 'ok\n' else printf 'failed!\n' estat=1 fi done if [ -n "${xfiles}" ]; then "${EDITOR}" INDEX.txt ${xfiles} fi exit ${estat} and the file is contaminated with NULs. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)