split_ptab.awk 481 B

1234567891011121314151617
  1. # extract one entry from the parameter table
  2. # var comes from the command line (with -v var=...)
  3. # for a match var has to be spelled EXACTLY as in the parameter table
  4. {
  5. if ($0 ~ "parameter") {
  6. lines=$0"\n"
  7. do {
  8. getline
  9. lines=lines$0"\n"
  10. if ( $1 == "out_name" ) { out_name=$3 }
  11. }
  12. while( $0 != "/" ) }
  13. if ( out_name == var ) {exit}
  14. }
  15. END { if ( out_name == var ) {print lines; exit 0} else {exit -1} }