Perl repeat string which has repeated substring

Viewed 72

I'm trying to print a string fbeq00000000000000000000 using perl in the terminal.

To avoid typing so many zeros I'm using

 perl -e 'print "fbeq" . "0" x 20'

Now, I want to print fbeq00000000000000000000 20 times which I am trying to achieve with

 perl -e 'print "fbeq" . "0" x 20 x 20'

Which is giving me incorrect output : fbeq0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

What I want is

fbeq00000000000000000000fbeq00000000000000000000fbeq00000000000000000000fbeq00000000000000000000fbeq00000000000000000000 ....

How do I achieve that?

Edit : I have tried : perl -e 'print ("fbeq" . "0" x 20) x 20' which gave incorrect results.

1 Answers

You can use brackets:

perl -e 'print(("fbeq" . "0" x 20) x 20)'
Related