Skip to content

Instantly share code, notes, and snippets.

@JohnArchieMckown
Last active December 11, 2017 16:27
Show Gist options
  • Save JohnArchieMckown/8e43461270d6078ecd87 to your computer and use it in GitHub Desktop.
Save JohnArchieMckown/8e43461270d6078ecd87 to your computer and use it in GitHub Desktop.
z/OS UNIX download method for CBTTape.org files.
#!/bin/sh
# Get one or more files from CBTtape.org
#
if [ $# -eq 0 ]; then #help
printf "%s\n" "This routine takes one or more file names as input." \
"These are the CBT file numbers to be downloaded." \
"This routine constructs and executes a \"curl\" command to download the file(s)." \
"Example: \"$0 290\" would run \"curl ftp://cbttape.org/ftp/cbt/CBT209.zip >CBT209.zip\"." \
"This results in the file CBT290.zip being placed in the current directory." \
"You can then \"unzip\" this using the command: jar -xvf CBT209.zip" \
"You then copy this into a z/OS sequential data set using the \"cp\" command, similar to:"\
"cp -B -W \"seqparms='recfm=fb,lrecl=80,blksize=0,space=(cyl,(10,1))'\" FILE209.XMI \"//xmit.file209\""
fi
while [ $# -ne 0 ];do
filename=$1
shift
curl http://cbttape.org/ftp/cbt/CBT${filename}.zip >|CBT${filename}.zip
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment