using nc to simulate a service

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ted Gould
Date:  
Subject: using nc to simulate a service
--=-p6L6s1I5aAQR18x60oaz
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2003-08-12 at 14:59, Jeremy C. Reed wrote:
> On Tue, 12 Aug 2003, Mike Starke wrote:
>=20
> > #! /usr/bin/perl
> > system ("touch /home/me/it_worked-$ARGV[0]");
>=20
> The "parameters" you mentioned are not command line arguments.
>=20
> They become the standard input to the script.


I realize that everything is good here now, but just a FYI for the
archive...

To do what you want there you should use something like:

cat parameters | xargs ./myscript.pl

xargs will take standard in and turn it into parameters on the command
line. I find this to be one of the most useful shell tools that I use.

        --Ted



--=-p6L6s1I5aAQR18x60oaz
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA/Oc/ALE335pRPGp0RAk0nAJ9t2aTF7QQToirK5kmRHfBopgHjuACg46s2
VTG4WEfzZDDjH1nBmvabQfc=
=LM8P
-----END PGP SIGNATURE-----

--=-p6L6s1I5aAQR18x60oaz--