#!/bin/bash if [ -z "$1" ]; then echo 'Nothing to get' exit 1 fi set -euo pipefail contents=$(gopass show "$1") || exit 1 echo "$contents" | grep '^user:' | cut -d' ' -f2 | xsel -b echo 'Username clipped' read -r _ gopass show --clip "$1"