1
2
3
4
5
6
7
#!/bin/sh
# Reads two lines: text up to cursor on one line and from the cursor
# (including) on the other. Then it computes byte-offsets (not character!) and
# passes it to plumb as single line with click attribute.
IFS= read -r lbuf
IFS= read -r rbuf
printf '%s' "$lbuf" "$rbuf" | plumb -a click=$(printf '%s' "$lbuf" |wc -c) "$@" -i