Make phantomjs run all '*.js' files in the current directory

て烟熏妆下的殇ゞ 提交于 2019-12-06 06:09:36

AFAIK phantomjs will only support one file at the time. You need to tell find to call phantomjs for each found file:

#!/bin/sh
find . -maxdepth 1 -name '*.js' -type f -exec phantomjs {} ';'

You can also use:

#!/bin/sh
for file in *.js; do
  [ -f "$file" ] || continue
  phantomjs "$file"
done
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!