Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (15)
As of 2016-12-05 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (83 votes). Check out past polls.