Skip to content

Instantly share code, notes, and snippets.

@lon9
Last active October 14, 2015 12:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lon9/170a33884b70c46cd716 to your computer and use it in GitHub Desktop.
コンピュータ・ネットワーク、ネットワーク・セキュリティのpdfファイルのパスワードをmacのクリップボードにコピーする
#!/bin/sh
CMDNAME=`basename $0`
CLASS=
if [ $# -ne 1 ]; then
echo "Usage: $CMDNAME <class-bunber>"
exit 1
fi
CLASS=$1
cat password.txt | awk 'NR == '$CLASS' {print $2}' | tr -d '\r' | tr -d '\n' | pbcopy
echo "Copied class $CLASS's password"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment