Strange syntex: beginner

N

Nagrik

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
 
C

ccc31807

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
 
T

Tony Curtis

ccc31807 said:
< 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
 
V

Vinay Nagrik

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
 
J

J. Gleixner

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

Jürgen Exner

Nagrik said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,209
Messages
2,571,088
Members
47,684
Latest member
sparada

Latest Threads

Top