Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Strange syntex: beginner

Reply
Thread Tools

Strange syntex: beginner

 
 
Nagrik
Guest
Posts: n/a
 
      03-20-2008
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
 
Reply With Quote
 
 
 
 
ccc31807
Guest
Posts: n/a
 
      03-20-2008
On Mar 20, 12:07 pm, Nagrik <vnag...@gmail.com> 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
 
Reply With Quote
 
 
 
 
Tony Curtis
Guest
Posts: n/a
 
      03-20-2008
ccc31807 wrote:
> On Mar 20, 12:07 pm, Nagrik <vnag...@gmail.com> 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

 
Reply With Quote
 
Vinay Nagrik
Guest
Posts: n/a
 
      03-20-2008
On Mar 20, 9:18*am, Tony Curtis <tony_curti...@yahoo.com> wrote:
> ccc31807 wrote:
> > On Mar 20, 12:07 pm, Nagrik <vnag...@gmail.com> 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
 
Reply With Quote
 
J. Gleixner
Guest
Posts: n/a
 
      03-20-2008
Vinay Nagrik wrote:
> On Mar 20, 9:18 am, Tony Curtis <tony_curti...@yahoo.com> wrote:
>> ccc31807 wrote:
>>> On Mar 20, 12:07 pm, Nagrik <vnag...@gmail.com> 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
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      03-21-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner's Beginner william nelson Ruby 7 04-11-2011 11:23 PM
AVG Email Scanner activating at strange times with strange IP addresses dennispublic@hotmail.com Computer Support 1 08-26-2006 04:27 AM
No Class at ALL!!! beginner/beginner question =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?= ASP .Net 7 02-03-2005 02:47 PM
Tutorial for beginner/ Tutorial voor beginner Rensjuh C++ 7 09-02-2004 12:41 AM
Question About Strange 'C' Code Syntax ( Well strange to me anyway ) Harvey Twyman C Programming 8 10-25-2003 05:54 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57