Relative Content

Tag Archive for bashperl

Convert string range into array of numbers in perl and prefix with another string [duplicate]

This question already has answers here: Perl sequence of numbers with leading zeros (2 answers) Closed 2 days ago. I have a string list (i.e: 1-15) and I want to generate this Scenario_01 … Scenario_10 Scenario_11 … Scenario_15 I tried this range=1-15 echo $range | perl -pe ‘s/(d+)-(d+)/join(” Scenario_0″,$1..$2)/eg’ and getting this 1 Scenario_02 Scenario_03 […]