Skip to content

Instantly share code, notes, and snippets.

@crosenth
Last active June 28, 2017 22:12
Show Gist options
  • Save crosenth/9cfc4667b15e305c068ef98ee1baa50b to your computer and use it in GitHub Desktop.
Save crosenth/9cfc4667b15e305c068ef98ee1baa50b to your computer and use it in GitHub Desktop.
header grep - Always print the first line of a file before grep
#!/usr/bin/env bash
csvfile=${@: -1}
head --lines 1 $csvfile && grep "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment