Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- DONGERS='/home/${USER}/Documents/crying-happy-donger-kaomojis-japanese-emoticons.txt'
- count=0
- mapfile -t array < "$DONGERS"
- total=${#array[@]}
- for donger in "${array[@]:0:10}"; do
- echo "$count: $donger"
- ((count++))
- done < $DONGERS
- read -n 1 -p "which donger? (press 'Enter' for more) " choice
- echo ""
- if [ $choice ]; then
- echo -n ${array["$choice"]} | xclip -sel clip
- exit
- fi
- for donger in "${array[@]:10:10}"; do
- echo "$count: $donger"
- ((count++))
- done < $DONGERS
- read -n 2 -p "which donger? " choice
- echo ""
- if [ $choice ]; then
- echo -n ${array["$choice"]} | xclip -sel clip
- exit
- fi
- remaining=$(( $total - 20 ))
- if [ $count -ge 20 ]; then
- for donger in "${array[@]:20:$remaining}"; do
- echo "$count: $donger"
- ((count++))
- done < $DONGERS
- read -p "which donger? " choice
- echo ""
- if [ $choice ]; then
- echo -n ${array["$choice"]} | xclip -sel clip
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement