Mark Constable wrote: > > Yes, I forgot to add the -n, as it turns out it still works... > > echo -en "AUTH 1\na\nb\nc\nd" | authProg > echo -en "AUTH 1\na\nb\nc\nd\n" | authProg > > Whew!!
Naturally, since the pipe closes. Notice what happens when you run the script interactively, as authdaemon would: # authProg AUTH 23 login username password If you don't hit enter at the end of "password", as authdeamon may not write a newline, the script will continue waiting for input, despite the promised 23 bytes of data. >> What would you rather see in an example? > > Well, a simple bash script somewhat like the one I posted, > perhaps generalized a bit more but kept as simple as possible. > > Why a bash script ? Because of set -x debugging. Perhaps better documentation, tutorial style, would fit the bill. Personally, I find the perl script much more readable. It's more concise, it describes each "word" of each line that it reads, it demonstrates writing optional values as a result, it conforms to the documented protocol, and it demonstrates that the pipe application should be persistent. There's a whole lot that's not shown by "set -x". :) I'm writing a lot of additional docs (for other things) right now. Maybe I'll try to figure out how to improve the documentation for authpipe, though it seems straightforward. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ courier-users mailing list [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
