Is there any way I can do it with bash scripting ?If you want bash scripting, you've come to the wrong site. If you'd like some help doing this with Perl scripting, I'd probably use indices 0-4 instead of A-E, make an array (my @values = (1, 7, 11, 3, 100)) and then split your coded strings:
my @terms = split //, $input; my $sum = 0; for my $i (0 .. @terms-1) { $sum += $values[$i] if $terms[$i] ne '?'; } print "$input = $sum\n";
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re: decoding pattern expression
by kennethk
in thread decoding pattern expression
by randome
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |