Last active
September 4, 2018 20:29
-
-
Save monkseal/9b840792a435168080fecbf88d9599e1 to your computer and use it in GitHub Desktop.
awk-sed-tricks.bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get 3rd word: | |
bundle exec rails routes | grep pages | awk '{print $3}' | |
# Get 3rd word without (format) | |
bundle exec rails routes | grep pages | awk '{ gsub("\\\(.:format\\\)","",$3); print $3}' | |
# Run eslint, substitute out full path/ directory for project 'home-page' | |
yarn run eslint app/javascript | grep javascript | sed -e 's/Users\/v-kevin.english\/Projects\/home-page\///' | |
# get last word from an output, use awk '{print $NF}' | |
echo "exporting file kevin-exports.2017-10-21.json" | grep exporting | awk '{print $NF}' | |
# Run all changes rspec files: | |
git ss | grep spec | awk '{print $2}' | xargs bundle exec rspec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment