#!/bin/sh tmp=$2.tmp rm -f $tmp $2 if cplex -c "read $1" "optimize" "write $tmp sol"; then grep '@@' > $2 rm -f $tmp else exit $? fi