Skip to content

Instantly share code, notes, and snippets.

Niko Dittmann niko

Block or report user

Report or block niko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View greparate.sh
function greparate() {
PATTERN=$1;
FILENAME=$2;
FILENAME_WITH=`echo $FILENAME | sed "s/\.\([^\.]*\)$/.with_$PATTERN.\1/"`;
FILENAME_WITHOUT=`echo $FILENAME | sed "s/\.\([^\.]*\)$/.without_$PATTERN.\1/"`;
echo "Seprating the content of $FILENAME by $PATTERN into $FILENAME_WITH and $FILENAME_WITHOUT"
grep $PATTERN $FILENAME > $FILENAME_WITH;
grep -v $PATTERN $FILENAME > $FILENAME_WITHOUT;
You can’t perform that action at this time.