#!/usr/local/bin/gawk -f # Call Structer and then Dotter BEGIN { for (i = 1; i <= ARGC-1; i++) opts = opts" "ARGV[i] command = "/am/MolBio/Sanger/bin/structer -d "opts while (command | getline) { #print "Line "++line" : " $0 print if ($0 ~ "View in Dotter by:") { command2 = substr($0, index($0, "dotter -R -l")) } } print "\nCalling dotter with: " command2 system(command2) }