Skip to content

Instantly share code, notes, and snippets.

@macoj
Created September 14, 2018 11:37
Embed
What would you like to do?
Filter some data based on some criteria with awk
#!/bin/bash
bb0=$1
bb1=$2
bb2=$3
bb3=$4
cat data.dat | awk -F '|' -v bb0="$bb0" -v bb1="$bb1" -v bb2="$bb2" -v bb3="$bb3" '$2 > bb0 && $2 < bb1 && $3 > bb2 && $3 < bb3 {print $0}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment