Say I have a text file test
chr1 16597656 16597657 Chr1:16924151
chr1 149015385 149015386 Chr1:144869084
chr1 148989775 148989776 Chr1:144894697
I need to modify the fourth column and get the result like this
chr1 16597656 16597657 Chr1:16924151 Chr1:16924150-16924151
chr1 149015385 149015386 Chr1:144869084 Chr1:144869083-144869084
chr1 148989775 148989776 Chr1:144894697 Chr1:144894696-144894697
I tried awk -F '[:]' '{print $1":"$2-1"-"$2}' test which doesn't print the fourth column in my result. What am I missing here?