Add headerline to the values

if header line starts with chr1 and span 10 print chr1 and the original values and ov+10 and viceversa

input

variableStep chrom=chr1 span=10
191     1
201     18
211     1
variableStep chrom=chr2 span=10
191     11
201     1
211     12

output

 
chr1 191 201     1
chr1 201 211     18
chr1 211 221     1
chr2 191 201     11
chr2 201 211     1
chr2 211 221     12

something like this,

 perl -nle 'if (/variableStep chrom=(.+?)\sspan=(\d+)/) { $a=$1;} elsif (/(\d+)\s+(\d+)/) {print "$a\t$1\t", $1+10 ,"\t$2";}' inputfile


#!/bin/bash
while read A B C
do
if [ "$A" = variableStep ]
then eval "$B; $C"
else echo -e "$chrom $A $((A+span))\t$B"
fi
done <infile

Which can also be written

#!/bin/bash
while read A B C
do [ "$A" = variableStep ] && eval "$B; $C" || echo -e "$chrom $A $((A+span))\t$B"
done <infile
maybe the test condition can be [ -n "$C" ] in state of [ "$A" = variableStep ]

With awk...

 
awk -F" |=" '/variableStep/{chrom=$3;span=$NF;next}{print chrom,$1,$1+span,$NF}' infile
awk '/^var/ {split($2,a,"=");split($3,b,"=");next}{print a[2],$1,$1+b[2],$2}' infile