Hi,

First; thank Greg for a simple solution!


Tip;
add '-r' to xclip to remove the trailing newline from the password


Version with head/tail instead of awk, whatever you prefer;

pass fubar | tee >(tail -n +2 > /dev/tty) \
      | head -1 | xclip -i -r -selection clipboard


Regards,
// mem



Den 2021-10-23 kl. 10:23, skrev Greg Minshall:
Mitch,

i think you could:
----
pass fubar | \
      tee >(awk 'NR > 1 {print}' > /dev/tty) | \
      awk 'NR == 1 { print }' | \
      xclip -i -selection clipboard
----
(YSMV == your shell may vary).

cheers, Greg

Reply via email to