D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] redirects and C

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Neil Williams wrote:
> I've seen and used this syntax:
> 
> $ prog < input.file > output.file
> 
> (but can't remember when or with which prog!)

Any which behaves as a "filter". Filter is the magic word. As in
"writing unix filters" ;)

> Can 'prog' be given options in such a syntax?

Of course.

> I'd like to see how it works in the source so if anyone knows of a program 
> that can do this (and which is written in C), it would be handy!

Try "apt-get source coreutils" for various examples - probably one of
the simplest is "tr".

There is a simpler example here, but whether than is upto GNU standards
I'm not sure.

http://www-128.ibm.com/developerworks/linux/library/l-clutil/

However there is a long way from my understanding of how they ought to
work, to coding it, and my C isn't upto it yet.
-----BEGIN PGP SIGNATURE-----
Comment: Encryption...is a powerful defensive weapon for free people.
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC6+WgGFXfHI9FVgYRAvtFAJ0Vx9E34aK+0GulbQbHbXwSE3wkfgCfYm99
PkkWCL1HI+wUWNMVNfIuFj8=
=al1i
-----END PGP SIGNATURE-----

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe. FAQ: www.dcglug.org.uk/linux_adm/list-faq.html