Skip to content

Instantly share code, notes, and snippets.

@meyju
Created August 18, 2016 11:33
Show Gist options
  • Save meyju/d8c85489a180816c1eaaed3885c18ea4 to your computer and use it in GitHub Desktop.
Save meyju/d8c85489a180816c1eaaed3885c18ea4 to your computer and use it in GitHub Desktop.
get file from line to line
#! /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