文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>一个脚本的多种实现方法

一个脚本的多种实现方法

时间:2006-06-09  来源:CUDev

因为我想根据一个url来动态生成一组连续的url,例如:
http://www.myweb.com/files/file101.txt/
===》
http://www.myweb.com/files/file102.txt/
http://www.myweb.com/files/file103.txt/
... ... ...
http://www.myweb.com/files/file160.txt/
所以我想取出http://www.myweb.com/files/file101.txt

代码:
#!/bin/sh

URL=http://www.myweb.com/files/file
ID=101

for i in {101..160}
do
echo "$URL$ID.txt/" >> file
let "ID+=1"
done

代码:
#!/bin/sh
URL=http://www.myweb.com/files/file

ID=101

while((ID<=160))
do
echo "$URL$ID.txt/" >> file
let "ID+=1"

done
代码:
#!/bin/sh

URL=http://www.myweb.com/files/file
ID=101

for i in $(seq 60)
do
echo "$URL$ID.txt/" >> file
let "ID+=1"

done
排行榜 更多 +
别惹神枪手安卓版

别惹神枪手安卓版

冒险解谜 下载
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载