Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Answer: Coding CTRL-D

by athomason (Curate)
on Jul 06, 2000 at 09:38 UTC ( #21275=categorized answer: print w/replies, xml ) Need Help??

Q&A > programs and processes > Coding CTRL-D - Answer contributed by athomason

<CTRL-D> can be displayed, printed, sent, or whatever by chr(4). However, this won't fix your script, since 1) echo isn't a Perl command, 2) if it were, it wouldn't print to smbclient, which I assume you're trying to do, and 3) you shouldn't need to send a <CTRL-D> if you do IPC the right way. You need something like

!#/usr/bin/perl -w use strict; my ($victim, $message) = ("joe", "bloop"); # open an output pipe to the external program open SMB, "| smbclient -M $victim"; # print on the pipe's handle print SMB $message; # close the handle, which implicitly sends an EOF close SMB;

Hope that helps.

Log In?

What's my password?
Create A New User
[choroba]: https://metacpan. org/author/ SIMBABQUE might know. He's a heavy Ingress player.
[Corion]: choroba: Yeah, I know :) I might ask him at the GPW :))

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-03-19 09:14 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (236 votes). Check out past polls.