Skip to content

Instantly share code, notes, and snippets.

@horitaku1124
Created April 11, 2013 11:58
Show Gist options
  • Save horitaku1124/5362816 to your computer and use it in GitHub Desktop.
Save horitaku1124/5362816 to your computer and use it in GitHub Desktop.
複数のコマンドを配列にして実行
#!/bin/bash
list=()
list+=("date '+%Y/%m/%d %H:%M:%S'")
list+=("date '+%Y-%m-%d %H:%M:%S'")
list+=("date '+%Y-%m-%d'")
for((i = 0; i < ${#list[@]}; i++))
do
echo ${list[$i]} | bash
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment