Skip to content

Instantly share code, notes, and snippets.

@tatumroaquin
Last active August 16, 2021 10:52
Show Gist options
  • Save tatumroaquin/b12bb0228f086c57c9fa0e11edb8d314 to your computer and use it in GitHub Desktop.
Save tatumroaquin/b12bb0228f086c57c9fa0e11edb8d314 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#author :ormux
#date :2019/08/31 (August 31)
#description :reads bookcode based on a given text, originally by clevcode
#title :readbookcode.sh
#usage :bash readbookcode.sh
read -p "bookcode filepath: " code
read -p "source filepath: " text
while read line; do
row=$(echo $line | cut -d\: -f1)
col=$(echo $line | cut -d\: -f2)
head -n$row $text | tail -n1 | head -c$col | tail -c1
done < $code
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment