1 #!/bin/sh 2 3 files=$(pm l | tr \\n ' ') 4 awk -vfiles="$files" -vstty="$(stty -g)" ' 5 BEGIN { 6 system("stty -echo") 7 printf("pass:") 8 getline pass 9 system("stty " stty) 10 11 split(files, a) 12 for (f in a) 13 print pass 14 } 15 ' | for f in $files; do 16 pm s "$f" | gpm "$@" add "$f" 17 done