Skip to content

Instantly share code, notes, and snippets.

@devlinjunker
Created February 11, 2022 18:16
Show Gist options
  • Select an option

  • Save devlinjunker/42e8ce6bf3cd0eefef966ec49059c605 to your computer and use it in GitHub Desktop.

Select an option

Save devlinjunker/42e8ce6bf3cd0eefef966ec49059c605 to your computer and use it in GitHub Desktop.
Reminder script
#! /bin/bash
# print last 20 lines
remember() {
cat ~/.bash_history | awk '{ if (NR % 2 == 0) print NR/2,$0 }' | awk '{ array[NR]=$0 } END { for (i=NR-20; i<=NR; i++) print array[i] }'
}
# TODO:
# - [ ] Accept parameters and check if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment