podhmo / ioknife

knives for io
0 stars 0 forks source link

focus -- something like head + tail and highlight #25

Open podhmo opened 4 years ago

podhmo commented 4 years ago

e.g.

run:
    go run ${TARGET}*/main.go | tee $$(echo ${TARGET}*/)output.txt
    @echo "----------------------------------------"
    @cat -n ${TARGET}*/main.go | head -n $$(( $$(cut -d : -f 1 $$(echo ${TARGET}*/)output.txt) + 1 )) | tail -n 3

output

go run 03*/main.go | tee $(echo 03*/)output.txt
49:VENV/individual-sandbox/daily/20191213/example_go/03panic/main.go
----------------------------------------
    48      var p *person
    49      fmt.Println(p.Name) // nil panic
    50  }