I built a little shell script to handle the inserting of trigger codes to an ascii print file...basically I have a file with the codes I need at the top of the print file and at the bottom, I cat them all together with the current print data and send to another print queue. It works well...
Now I want to actually insert codes into the middle of the file...ie: I want to goto line 2 and insert some stuff into the begining of that line, or I want to search for a paticular word and insert stuff there...I need help...I'd like to do this all as variables (I mean I don't want to write an acutal data file, unless you can tell me how to create a filename that is random so that if this script is being run by multiple users it won't overwrite..
My current script..
for FILE in $*
cat $HEADER $FILE $TRAILER | lp -d $QUEUE
In vi use in insertmode CTRL-v to insert keycodes or esc-codes. It takes effect for one character. Use CTRL-v again for the next character.
CTRL-v RETURN gets an ^M. In vi you see two charakters, but it is only one charakter (DEZ 13) Carrige Return.
Use CTRL-v CTRL-L and you get a ^L ( Form-Feed to a printer )
Use CTRL-v ESC and you get a ^[ ( ESC-character )