aboutsummaryrefslogtreecommitdiff
path: root/extract_field.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extract_field.sh')
-rwxr-xr-xextract_field.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/extract_field.sh b/extract_field.sh
new file mode 100755
index 0000000..aab4b6a
--- /dev/null
+++ b/extract_field.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# Usage: ./extract_field.sh DBNAME KEY FIELDIDX
+
+awk 'BEGIN { FS = ":" } $1 == "'"$2"'" { print $'"$3"'}' < $1