[TUHS] Seeking wisdom from Unix Greybeards

Steffen Nurpmeso steffen at sdaoden.eu
Fri Nov 27 07:56:53 AEST 2020


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)


More information about the TUHS mailing list