Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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...

Replies are listed 'Best First'.
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.


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.


    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 Anonymous Monk on Oct 13, 2013 at 19:46 UTC

    if it is a file use read.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1058097]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2017-12-16 17:13 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (457 votes). Check out past polls.