Strange syntex: beginner

Discussion in 'Perl Misc' started by Nagrik, Mar 20, 2008.

  1. Nagrik

    Nagrik Guest

    Hello Group,

    I am new to learning Perl and am struggling with a syntex encountered
    in the code. It looks like

    < a.txt b.pl > signature

    My question is

    what does the first character (<) mean.

    What b.pl is doing with a.txt.

    I guess the output of the program goes to signature.

    BTW: The line I mentioned was in a bash script file.

    Can someone help.

    Thanks.

    nagrik
     
    Nagrik, Mar 20, 2008
    #1
    1. Advertising

  2. Nagrik

    ccc31807 Guest

    On Mar 20, 12:07 pm, Nagrik <> wrote:
    > Hello Group,
    >
    > I am new to learning Perl and am struggling with a syntex encountered
    > in the code. It looks like
    >
    > < a.txt b.pl > signature
    >
    > My question is
    >
    > what does the first character (<) mean.
    >
    > What b.pl is doing with a.txt.
    >
    > I guess the output of the program goes to signature.
    >
    > BTW: The line I mentioned was in a bash script file.
    >
    > Can someone help.
    >
    > Thanks.
    >
    > nagrik



    < and > are redirection operators. The line you quote can be
    translated as follows:

    Get the input (<) from the file named 'a.txt', run the script named
    'b.pl', and write the output (>) to the file named 'signature'.

    CC
     
    ccc31807, Mar 20, 2008
    #2
    1. Advertising

  3. Nagrik

    Tony Curtis Guest

    ccc31807 wrote:
    > On Mar 20, 12:07 pm, Nagrik <> wrote:
    >> Hello Group,
    >>
    >> I am new to learning Perl and am struggling with a syntex encountered
    >> in the code. It looks like
    >>
    >> < a.txt b.pl > signature
    >>
    >> My question is
    >>
    >> what does the first character (<) mean.
    >>
    >> What b.pl is doing with a.txt.
    >>
    >> I guess the output of the program goes to signature.
    >>
    >> BTW: The line I mentioned was in a bash script file.
    >>
    >> Can someone help.
    >>
    >> Thanks.
    >>
    >> nagrik

    >
    >
    > < and > are redirection operators. The line you quote can be
    > translated as follows:
    >
    > Get the input (<) from the file named 'a.txt', run the script named
    > 'b.pl', and write the output (>) to the file named 'signature'.


    but that's not perl, BTW

    hth
    t
     
    Tony Curtis, Mar 20, 2008
    #3
  4. Nagrik

    Vinay Nagrik Guest

    On Mar 20, 9:18 am, Tony Curtis <> wrote:
    > ccc31807 wrote:
    > > On Mar 20, 12:07 pm, Nagrik <> wrote:
    > >> Hello Group,

    >
    > >> I am new to learning Perl and am struggling with a syntex encountered
    > >> in the code.  It looks like

    >
    > >> < a.txt b.pl > signature

    >
    > >> My question is

    >
    > >> what does the first character (<) mean.

    >
    > >> What b.pl is doing with a.txt.

    >
    > >> I guess the output of the program goes to signature.

    >
    > >> BTW: The line I mentioned was in a bash script file.

    >
    > >> Can someone help.

    >
    > >> Thanks.

    >
    > >> nagrik

    >
    > > < and > are redirection operators. The line you quote can be
    > > translated as follows:

    >
    > > Get the input (<) from the file named 'a.txt', run the script named
    > > 'b.pl', and write the output (>) to the file named 'signature'.

    >
    > but that's not perl, BTW
    >
    > hth
    > t- Hide quoted text -
    >
    > - Show quoted text -


    As I said earlier this line was written in a bash script, and looks
    like reading a file inside a perl script and then outputing it.

    nagrik
     
    Vinay Nagrik, Mar 20, 2008
    #4
  5. Nagrik

    J. Gleixner Guest

    Vinay Nagrik wrote:
    > On Mar 20, 9:18 am, Tony Curtis <> wrote:
    >> ccc31807 wrote:
    >>> On Mar 20, 12:07 pm, Nagrik <> wrote:
    >>>> Hello Group,
    >>>> I am new to learning Perl and am struggling with a syntex encountered
    >>>> in the code. It looks like
    >>>> < a.txt b.pl > signature
    >>>> My question is
    >>>> what does the first character (<) mean.
    >>>> What b.pl is doing with a.txt.
    >>>> I guess the output of the program goes to signature.
    >>>> BTW: The line I mentioned was in a bash script file.
    >>>> Can someone help.
    >>>> Thanks.
    >>>> nagrik
    >>> < and > are redirection operators. The line you quote can be
    >>> translated as follows:
    >>> Get the input (<) from the file named 'a.txt', run the script named
    >>> 'b.pl', and write the output (>) to the file named 'signature'.

    >> but that's not perl, BTW
    >>
    >> hth


    > As I said earlier this line was written in a bash script, and looks
    > like reading a file inside a perl script and then outputing it.


    As Tony said earlier, "that's not perl". Or more bluntly, the
    redirection operators in a bash script have nothing at all to
    do with perl, so why are you asking in this newsgroup?

    Ask what it does in a bash newsgroup or experiment with it on your
    own. Hint: run it with a made up file name, instead of one that
    exists.

    < dummy b.pl > signature
     
    J. Gleixner, Mar 20, 2008
    #5
  6. Nagrik <> wrote:
    >I am new to learning Perl and am struggling with a syntex encountered
    >in the code. It looks like
    >
    >< a.txt b.pl > signature
    >
    >My question is
    >
    >what does the first character (<) mean.


    That depends on the context. Could be a "smaller than" comparision. Could be
    the input operator. Could probably be several more things.

    >What b.pl is doing with a.txt.


    Nothing? At least nothing that could be determined without context. As far
    as Perl is concerned that code snippet is a syntax error.

    >I guess the output of the program goes to signature.


    Well, it could also be a "larger than" comparison or the closing bracket of
    input operator or ...

    >BTW: The line I mentioned was in a bash script file.


    Oh, you weren't talking about Perl? Then why didn't you say so in the first
    place?

    >Can someone help.


    What about the guys over in the bash scripting NG?

    jue
     
    Jürgen Exner, Mar 21, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nikhil Patel

    client script syntex error

    Nikhil Patel, Oct 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,156
    Nikhil Patel
    Oct 7, 2004
  2. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    No Class at ALL!!! beginner/beginner question

    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    594
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
    Feb 3, 2005
  3. Aryeh M. Friedman

    1.5.0 Syntex Question

    Aryeh M. Friedman, Mar 17, 2005, in forum: Java
    Replies:
    2
    Views:
    1,683
    Alan Moore
    Mar 17, 2005
  4. Rensjuh
    Replies:
    7
    Views:
    981
    Mabden
    Sep 2, 2004
  5. froil
    Replies:
    4
    Views:
    123
    Jürgen Exner
    Mar 8, 2006
Loading...

Share This Page