**Can I transfer this first format to the second one just by basic shell procession or awk or sed on linux? This is a toy example:**

This kind of text file is what I have, three cols, col2 and col3 like range, left close and right open,    
chr1 0 2 0    
chr1 2 6 1.5    
chr2 0 3 0    
chr2 3 10 2.1

Transfer to describe each position as:    
chr1 0 0    
chr1 1 0   
chr1 2 1.5    
chr1 3 1.5    
chr1 4 1.5    
chr1 5 1.5    
chr2 0 0        
chr2 1 0    
chr2 2 0      
chr2 3 2.1    
...    
chr2 9 2.1  

Someone has idea how to solve? Thanks!!! 
If you want to use set operations:

    $ bedops --chop 1 foo.bed | bedmap --faster --echo --echo-map-id --delim "\t" - foo.bed | cut -f1,2,4 > answer.txt