If you have installed shapelib, you can create shapefiles from the bash shell prompt like this:
shpcreate triangle.shp polygon shpadd triangle.shp 1 1 2 2 -2 2 1 1 dbfcreate triangle.dbf -n id 6 2 -s label 200 dbfadd triangle.dbf 1 test
Shpadd just takes a stream of coordinate pairs. Dbfcreate uses -n [name] [size] [decimals] for numeric fields and -s [name] [size] for string fields.