Skip to content

Instantly share code, notes, and snippets.

@gialloporpora
Created July 31, 2012 17:23
Show Gist options
  • Save gialloporpora/3218706 to your computer and use it in GitHub Desktop.
Save gialloporpora/3218706 to your computer and use it in GitHub Desktop.
Batch file to emulate tail command using SED
@echo off
if "%2"=="" (set lines=3) else (set lines=%2)
set /a lines=%lines% + 1
set sed="$q;N;%lines%,$D;ba"
sed -e :a -e %sed% %1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment