Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (18 sloc) 495 Bytes
#!/bin/bash
function require(){
PROGRAM="$1"
ALTERNATIVE="$2"
if command -v $PROGRAM >/dev/null 2>&1; then
echo $PROGRAM
return
else
if command -v $ALTERNATIVE >/dev/null 2>&1; then
echo $ALTERNATIVE;
else
echo "Missing required program: $PROGRAM"
exit 1
fi
fi
}
COPY=$(require pbcopy "xsel -b")
echo -n "Your password is in another castle" | $COPY