Skip to content

Instantly share code, notes, and snippets.

@louisswarren
Last active March 27, 2016 05:28
Show Gist options
  • Save louisswarren/ff2c0d7e2ee6d6f7fb69 to your computer and use it in GitHub Desktop.
Save louisswarren/ff2c0d7e2ee6d6f7fb69 to your computer and use it in GitHub Desktop.
Script for viewing long files in tty using only head, tail, echo, bc
#!/bin/sh
# Use to view long files without more or less
# One-liner so that it may be easily echo'd to /bin/pcat instead of using ed
# Usage:
# pcat filename pagenum
head -n $(echo "$2 * 20" | bc) $1 | tail -n 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment