fork download
  1. #!/usr/bin/env bash
  2. # ^^^^- must be really bash, not /bin/sh
  3.  
  4. location_re='location=(0x[[:xdigit:]]+)([[:space:]]|$)'
  5.  
  6. while read -r line; do
  7. if [[ $line =~ $location_re ]]; then
  8. hex=${BASH_REMATCH[1]}
  9. dec=$(( $hex ))
  10. printf '%s\n' "${line/location=$hex/location=$dec}"
  11. else
  12. printf '%s\n' "$line"
  13. fi
  14. done
  15.  
Success #stdin #stdout 0s 19712KB
stdin
12 ,         maze|style=0x48570006, column area #=0x7, location=0x80000d
13 ,         maze|style=0x48570005, column area #=0x7, location=0x80aa0d
stdout
12 ,         maze|style=0x48570006, column area #=0x7, location=8388621
13 ,         maze|style=0x48570005, column area #=0x7, location=8432141