Last active
August 29, 2015 13:58
-
-
Save parnurzeal/9966431 to your computer and use it in GitHub Desktop.
A solution for grep a file with too long line. Usage: ./grep_too_long_line.sh FILE WORD_TO_CUT WORD_TO_FIND
This file contains 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
#!/bin/bash | |
ORG_FILE=$1 | |
WORD_TO_CUT=$2 | |
WORD_TO_FIND=$3 | |
zcat ${ORG_FILE} | sed 's/'${WORD_TO_CUT}'/'${WORD_TO_CUT}'\n/g' | grep ${WORD_TO_FIND} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment