All of the examples from the AMPL Book can be found on ampl.com
To run these examples with glpsol, you will need a command line like
glpsol -m prod.mod -d prod.dat
note that solve and display statements can be added to model file
in GMPL. There is also printf in GMPL for more control over
output. See Chapter 4 in the
GNU MathProg Reference
for more information. See also triangle for a simple example of using display.