14 BEGIN {_s = tolower(_s)}
16 /^[^ \t]/ && tolower($1) ~ _s && NF >= 2 {
29 } # TODO What would NF > 4 mean?
31 printf("%d [O] s:\"%s\", e:\"%s\", u:\"%s\"\n", n, s, e, u) > "/dev/stderr"
36 printf("%d [C] s:\"%s\", e:\"%s\", u:\"%s\"\n", n, s, e, u) > "/dev/stderr"
38 printf("%d s:\"%s\" e:\"%s\" u:\"%s\" %s\n", n, s, e, u, p)
45 local -r default_file
="$HOME"/._p
/p
46 local -r usage
="Usage: $PROG [FILE] NAME"
47 local name
file records i meta data datum
68 records
=$
(find "$name" "$file")
69 meta
=$
(echo "$records" |
awk '{print($1, $2, $3, $4)}')
70 data
=$
(echo "$records" |
awk '{print($1, $5)}')
72 # XXX Even an empty result will count as one line after echo, so need to filter:
73 case "$(echo "$records" | grep -vc '^$')" in
75 echo '[ERROR] Found nothing.' >&2
82 i
=$
(echo "$meta" |
column -t | fzf |
awk '{print $1}')
83 datum
=$
(echo "$data" |
awk -v i
="$i" 'NR == i')
87 # XXX Intentionally avoiding newline:
88 echo "$datum" |
awk '{printf "%s", $2}' | xsel
-i -b -t 30000