Created
September 3, 2011 23:00
-
-
Save dpo/1191912 to your computer and use it in GitHub Desktop.
Simple AMPL Decoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This script helps save keystrokes when decoding AMPL models. | |
# | |
# "amplog name.mod" means "ampl -ogname name.mod" | |
# "amplog name2 name.mod" means "ampl -ogname2 name.mod" | |
# "amplog name2 name.mod name.dat" means "ampl -ogname2 name.mod name.dat" | |
# | |
dat= | |
if (( $# == 1 )); then | |
mod=$1 | |
nl=`basename $1 .mod` | |
elif (( $# >= 2 )); then | |
nl=`basename $1 .nl` | |
mod=$2 | |
fi | |
(( $# >= 3 )) && dat=$3 | |
ampl -og${nl} ${mod} ${dat} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment