Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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?
[stevieb]: finally, my MCP41010 digital potentiometers have arrived! This will be my first crack at writing C code to maniuplate hardware directly by reading the datasheet only (no code reviews before starting)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2017-01-19 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (172 votes). Check out past polls.