Skip to content

Instantly share code, notes, and snippets.

@27Cobalter
Last active May 2, 2018 16:47
Show Gist options
  • Save 27Cobalter/d74019cf779276026959528638abbb75 to your computer and use it in GitHub Desktop.
Save 27Cobalter/d74019cf779276026959528638abbb75 to your computer and use it in GitHub Desktop.
いい感じのディテクトリ構造にする
#!/bin/bash
# Usage: $ voice.sh dir
dir=$1
cd $1
mkdir etc game_command stage_name
array=("stage_name/normal_first_half" "stage_name/normal_half_time" "stage_name/normal_second_half" "stage_name/extra_first_half" "stage_name/extra_half_time" "stage_name/extra_second_half" "stage_name/penalty_shootout" "stage_name/post_game" "game_command/halt" "game_command/stop" "game_command/normal_start" "game_command/force_start" "game_command/prepare_kickoff_yellow" "game_command/prepare_kickoff_blue" "game_command/prepare_penalty_yellow" "game_command/prepare_penalty_blue" "game_command/direct_free_yellow" "game_command/direct_free_blue" "game_command/indirect_free_yellow" "game_command/indirect_free_blue" "game_command/timeout_yellow" "game_command/timeout_blue" "game_command/goal_yellow" "game_command/goal_blue" "game_command/ball_placement_yellow" "game_command/ball_placement_blue" "etc/red_card_yellow" "etc/red_card_blue" "etc/yellow_card_yellow" "etc/yellow_card_blue" "etc/yellow_card_timeup_yellow" "etc/yellow_card_timeup_blue" "etc/timeout_timeup_yellow" "etc/timeout_timeup_blue")
i=0
for j in `ls -l | grep -v ^d | grep -v sh | awk '{print $9}'`; do
mv $j ${array[$i]}.wav
i=$((i+1))
done
cp stage_name/extra_first_half.wav stage_name/extra_first_half_pre.wav
cp stage_name/extra_second_half.wav stage_name/extra_second_half_pre.wav
cp stage_name/normal_first_half.wav stage_name/normal_first_half_pre.wav
cp stage_name/normal_second_half.wav stage_name/normal_second_half_pre.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment