#!/usr/bin/env bash #----------------------------------------------------------------------- # call: tiki_get_file file_gallery filename # # where book = cdfpewk, cdfpbot, cdfpexo etc # # assume that the tcl file is stored in the BLOG called $book.tcl_files # and the posting name is $dataset.tcl # assume it is sourced #----------------------------------------------------------------------- export GALLERY=$1 export FILENAME=$2 tmp_file=/tmp/$$.tmp #----------------------------------------------------------------------- cat < $tmp_file use tiki select file.data from tiki_files file, tiki_file_galleries gal where gal.name='$GALLERY' and gal.galleryId=file.galleryId and file.filename='$FILENAME' ; exit EOF # cat $tmp_file mysql -u cdf_reader --password=reader -A -h ncdf41.fnal.gov < $tmp_file | \ sed 's/ //g' | sed 's/\\n//g' | tr "" "\n" | \ awk '{ if ($0 != "data") print $0}' rm $tmp_file