Last active
June 7, 2016 12:05
-
-
Save Iruyan-Zak/0be22250ec3307dfffe5af27c7ad8ef3 to your computer and use it in GitHub Desktop.
% assign.sh sheets.txt namelist.txt # 席替えスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage assign.sh 座席表 名簿 [置換対象の文字列] | |
set -eu | |
: $1 $2 | |
sep=${3:-ps} | |
tmp_file=$(mktemp) && cp $1 $tmp_file | |
cat $2 | shuf | sed -e "s/ /\\\\ /g" | xargs -I {} sed -i "0,/$sep/s/$sep/{}/" $tmp_file | |
trap "cat $tmp_file && rm $tmp_file" 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
北海道 | |
青森 | |
岩手 | |
宮城 | |
秋田 | |
山形 | |
福島 | |
茨城 | |
栃木 | |
群馬 | |
埼玉 | |
千葉 | |
東京 | |
神奈川 | |
新潟 | |
富山 | |
石川 | |
福井 | |
山梨 | |
長野 | |
岐阜 | |
静岡 | |
愛知 | |
三重 | |
滋賀 | |
京都 | |
大阪 | |
兵庫 | |
奈良 | |
和歌山 | |
鳥取 | |
島根 | |
岡山 | |
広島 | |
山口 | |
徳島 | |
香川 | |
愛媛 | |
高知 | |
福岡 | |
佐賀 | |
長崎 | |
熊本 | |
大分 | |
宮崎 | |
鹿児島 | |
沖縄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
沖縄 | |
山形 | |
愛媛 千葉 | |
秋田 | |
岡山 | |
佐賀 茨城 | |
新潟 京都 | |
福島 鳥取 石川 滋賀 | |
埼玉 三重 広島 | |
岩手 静岡 富山 北海道 徳島 | |
長崎 長野 群馬 | |
青森 山梨 和歌山 栃木 香川 福岡 | |
熊本 兵庫 岐阜 | |
山口 宮城 鹿児島 大分 高知 | |
宮崎 | |
奈良 島根 福井 | |
東京 神奈川 | |
愛知 | |
大阪 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps | |
ps | |
ps ps | |
ps | |
ps | |
ps ps | |
ps ps | |
ps ps ps ps | |
ps ps ps | |
ps ps ps ps ps | |
ps ps ps | |
ps ps ps ps ps ps | |
ps ps ps | |
ps ps ps ps ps | |
ps | |
ps ps ps | |
ps ps | |
ps | |
ps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment