*************************************************** * macro opt_pop * * Peter Niessen, 24.8.00, niessen@ifh.de * * a macro to retrieve the opt environment * * read the current opt from a file. Filename is * .pawopt.[n], where n is * an index representing the stack depth *************************************************** macro opt_pop * in case you have aliased your rm to rm -i, uncomment the next line * and substitute unaliased_rm_shell with a shell where you do not alias * kuip/set/host_shell unaliased_rm_shell * find out how many files there are n = $SHELL ('ls .pawopt* | wc -l') n = $WORD ([n],1,1,' ') | get rid of leading spaces if [n]=0 then mess 'no .pawopt file to pop' exitm endif oldname = '.pawopt.'//[n] optvalues = $SHELL ('cat .pawopt.* | grep -v "+" | grep -v "HPLOPT" | grep -v "Current" | awk ''{if ("|"==$1 && "|"!=$2) {print $2}}''') nvalues = $WORDS([optvalues], ' ') do i = 1, [nvalues] value = $WORD([optvalues],[i],1,' ') mess [value] opt [value] enddo sh rm -f [oldname] exitm return