Skip to content

Instantly share code, notes, and snippets.

@happypeter
Created August 10, 2017 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save happypeter/82febe81714394cc0ba87370597a7046 to your computer and use it in GitHub Desktop.
Save happypeter/82febe81714394cc0ba87370597a7046 to your computer and use it in GitHub Desktop.
当前文件夹下的所有 .mp4 文件,转换成一个 js 的 object
echo '[' > output.js
for item in `ls *.mp4`
do
if [ "$item" = "list.sh" ]
then
continue
fi
echo """ {
title: 'xxx',
link: '$item'
},""">>output.js
done
echo ']' >>output.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment