Created
August 18, 2016 11:33
-
-
Save meyju/d8c85489a180816c1eaaed3885c18ea4 to your computer and use it in GitHub Desktop.
get file from line to line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/env bash | |
filename=$1 | |
firstline=$2 | |
lastline=$3 | |
# Usage: ./get_file_body.sh 10 15 access.log | |
awk -vs="$firstline" -ve="$lastline" 'NR>=s&&NR<=e' "$filename" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment