#!/bin/bash MASK="bowshocks" #Output files: # FOUT - list of the bow shock records # FALL - list of the bow shock recoreds with IMF/plasma parameters EXT="73-00" FOUT=$MASK$EXT FALL="bs_"$EXT".txt" #Input files are $MASK$i where $i is from the $LIST LIST="73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 00" # ------------------------------------------- # You probably should not change things below SCRIPT="__##idl.scr##" SUN="SunOS" create_idl_script() { echo 'get_bs_att, "'$FOUT'", "'$FALL'"' >> $SCRIPT echo 'exit' >> $SCRIPT } remove_idl_script() { rm -f $SCRIPT } run_idl() { uname | grep $SUN >/dev/null 2>&1 if [ $? -eq 0 ]; then IDL_PATH=\+/usr/local/rsi/idl/lib:+${HOME}/idl:+/lepasz/user/asz/idl/lib:+/lepmfi/user/asz/idl/lib:/lepmfi/data/wind/istplib IDL_STARTUP=$HOME/idl/idlstartup IDL_MASTER_PATH=/lepmfi/user/asz/idl/lib/aplot/ export IDL_PATH IDL_STARTUP IDL_MASTER_PATH fi create_idl_script idl $SCRIPT remove_idl_script } [ -f $FOUT ] && rm $FOUT for i in $LIST; do if [ ! -f $MASK$i ]; then echo "Error: File $MASK$i not found." exit 1 fi if [ -f $FOUT ]; then tail +2 $MASK$i >> $FOUT else cat $MASK$i > $FOUT fi done echo "Created shock list $FOUT." run_idl echo "Finished creating shock list with upstream/downstream parameters $FALL."