Skip to content

Instantly share code, notes, and snippets.

@troyscott
Created February 17, 2012 08:22
Show Gist options
  • Save troyscott/1851799 to your computer and use it in GitHub Desktop.
Save troyscott/1851799 to your computer and use it in GitHub Desktop.
Extract lines from file using sed script
#!/usr/bin/env bash
# h,f represent repeating content that could be
# required in multiple files.
h="1,15p"
f="122,125p"
sed -n "$h;44,56p;$f" index.html > last_hour_m1-page.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment