regex - correct pattern to change array values in bash -
I need to strip 0 before all values of an array, e.g. Change
array = (01 02 03 [...] 10 [...] 20 [...]) to
array = (1 2 3 [...] 10 [...] 20 [...]) I think I can do it together Can I get rid of the syntax? I have lost much of the syntax for $ {parameter / pattern / string} .
Given that it is an array of numbers, instead of trying to replace it string arithmetic :
$ a = ({01.20}) $ "one dollar [one [@]}" $ icho "$ {a [@]}" $ 02 ($ 10 ($ 10) ($ 10 ($ 10)); $ $ Echo "$ {b [@ ]} "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Here $ ((10 # $ i)) variable i will be assessed as base 10 number.
Comments
Post a Comment