Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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
[Corion]: marto: Yeah, even though I didn't write any code :)
[Corion]: But at least I have a plan of action to move the site to https, played some (free!) VR games with friends and watched the plans for the next German Perl workshop progress ;)
[Corion]: AltSpace VR is amazingly good - highly polished and with some of the games you get for free what you'd pay EUR 20 or EUR 40 otherwise
[Corion]: But maybe it's also due to that I play with friends, which makes a game more enjoyable anyway ;)
[Corion]: Oh - I released a new version of some module, thanks to a pull request. But I don't consider "update Makefile.PL" and "update author tests" as "writing code" ;-D

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2017-08-21 09:26 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (319 votes). Check out past polls.