Skip to content

Instantly share code, notes, and snippets.

@myamamic
Created December 14, 2012 10:56
Show Gist options
  • Select an option

  • Save myamamic/4284580 to your computer and use it in GitHub Desktop.

Select an option

Save myamamic/4284580 to your computer and use it in GitHub Desktop.
[script][DB] sqlite3 データベースにエントリをたくさん追加したときのスクリプト
#!/bin/bash
# sqlite3 データベースにエントリをたくさん追加したときのスクリプト
# - これはmediatomb.dbに同じビデオコンテンツをたくさん追加している
i=106
j=15
while [ $j -le 60 ];
do
SENTENCE="INSERT INTO \"mt_cds_object\" VALUES($i,77,82,2,NULL,'1920x1080_1Mbps_60M_$j.mp4',NULL,NULL,NULL,NULL,NULL,0,'video/mp4',1,NULL,NULL);"
echo $SENTENCE
sqlite3 mediatomb.db "$SENTENCE"
i=`expr $i + 1`
j=`expr $j + 1`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment