Click here to get back home

Strange syntex: beginner

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Strange syntex: beginner Nagrik 03-20-2008
Posted by Nagrik on March 20, 2008, 12:07 pm
Please log in for more thread options
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

Posted by ccc31807 on March 20, 2008, 12:14 pm
Please log in for more thread options
> 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

Posted by Tony Curtis on March 20, 2008, 12:18 pm
Please log in for more thread options
ccc31807 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


Posted by Vinay Nagrik on March 20, 2008, 5:01 pm
Please log in for more thread options
> ccc31807 wrote:
> >> Hello Group,
>
> >> I am new to learning Perl and am struggling with a syntex encountered
> >> in the code. =A0It 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

Posted by J. Gleixner on March 20, 2008, 7:43 pm
Please log in for more thread options
Vinay Nagrik wrote:
>> ccc31807 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

Similar ThreadsPosted
Help with error 500, but compiles and runs on my server and syntex checks out March 7, 2006, 7:27 pm
[BEGINNER] Regex with ~ April 1, 2005, 8:04 am
[BEGINNER} Question April 4, 2005, 8:01 am
Beginner Question #1 April 12, 2005, 6:27 am
Beginner DBI problem October 18, 2005, 7:06 pm
use of uninitialized value (beginner) June 21, 2006, 1:12 am
Beginner: match /$key/ August 3, 2006, 12:56 am
A Perl Beginner March 19, 2007, 10:39 am
Learning PERL for a new beginner February 4, 2005, 1:18 am
forms, cgi - beginner question February 15, 2005, 10:39 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap