Fix bug in tools/cat bash script