Skip to content

Instantly share code, notes, and snippets.

@asukaminato0721
Created December 25, 2021 08:25
Show Gist options
  • Save asukaminato0721/373c4e972623f4797bc2f8bd806de38d to your computer and use it in GitHub Desktop.
Save asukaminato0721/373c4e972623f4797bc2f8bd806de38d to your computer and use it in GitHub Desktop.
a simple script which can show text files easily.
#!/bin/bash
for fn in "$@"
do
[[ -s "$fn" ]] && iconv < "$fn" -f $(uchardet "$fn") -t utf8 | less
done
# you can just use it like cat, alias cat=autocat.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment