Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

sed input line from keyboard

by Anonymous Monk
on Oct 13, 2013 at 19:44 UTC ( #1058097=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hi friends
i want take a single input line from keyboard to execute sed command....if it is a line no problem we can use read f but if input line it is not getting...

Comment on sed input line from keyboard
Re: sed input line from keyboard
by Anonymous Monk on Oct 13, 2013 at 19:46 UTC

    if it is a file use read.

Re: sed input line from keyboard
by CountZero (Bishop) on Oct 13, 2013 at 20:38 UTC
    my $inputline = <STDIN>; will read one line from standard input.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
Re: sed input line from keyboard
by Old_Gray_Bear (Bishop) on Oct 13, 2013 at 21:41 UTC
    sed() is not Perl. That said, what is wrong with using the Bash variable(s) that contain the command line input data? That is what they are there for. (and, by the way, sed-monks is three doors down on the left.)

    ----
    I Go Back to Sleep, Now.

    OGB

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1058097]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-12-19 04:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (70 votes), past polls