insertinput (344B)
1 #!/bin/sh 2 read -r ipt 3 os=$(uname -s | tr '[:upper:]' '[:lower:]') 4 case "$os" in 5 linux*) 6 # code for Linux 7 ;; 8 darwin*) 9 osascript -e "tell application \"System Events\" to keystroke \"$ipt\"" 10 ;; 11 msys*|cygwin*|mingw*|nt|win*) 12 # code for Windows 13 ;; 14 *) 15 printf "Operating system %s is unknown.\n" "$os" 16 ;; 17 esac