Skip to content

Instantly share code, notes, and snippets.

@niltonvasques
Created January 18, 2016 12:54
Show Gist options
  • Select an option

  • Save niltonvasques/a6af1739de629ccb5d44 to your computer and use it in GitHub Desktop.

Select an option

Save niltonvasques/a6af1739de629ccb5d44 to your computer and use it in GitHub Desktop.
List files in two directories, replace some string, subtract them and finaly copy result to clipboard.
#!/bin/bash
awk 'NR==FNR{a[$1];next}!($1 in a)' <(ls | sed 's/_spec.rb//g' | sort) <(ls ../../app/models/ | sed 's/.rb\|.bak//g' | uniq | sort) | awk '{ print "- [ ]",$1 }' | xclip -sel clip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment