#! /bin/bash # Last edited on 2008-06-15 08:21:49 by stolfi # Usage: "ncbi_head ${id} # Fetches the first 20 lines of the NCBI file "${id}" # in Genbank format, and prints them to stdout. # The ${id} may or may not have a version number, # e.g. "NC_003076.5" or "NC_003076". The # second option retrieves the latest vestion. # Parse command line args if [[ $# -ne 1 ]]; then echo "wrong nargs" 1>&2 ; fi id="$1"; shift # Fetch the data ncbi="http://www.ncbi.nlm.nih.gov/entrez/viewer.cgi" echo "=== ${id} ===" wget -nv "${ncbi}?db=nucleotide&val=${id}&save=on&view=gb" -O - | head -20