2012 年二月 一 二 三 四 五 六 日 « 一 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 近期评论
- wlx [微博 ] 发表在《google彻底被封?》
- snake 发表在《google彻底被封?》
- Andrew Pelt 发表在《debian testing上安装oracle 10g》
- tiplip 发表在《webmap.cn使用的WEBGIS技术》
- 求助Evolution问题!! 发表在《evolution crashed in gutsy alpha》
分类目录
标签
anjuta apache backup breezy c++ compile convert dapper debian dns edgy evolution feisty firefox flash gnome gobang GRASS gutsy humor intrepid Linux mailman MapServer mysql openoffice Oracle php phpbb postfix PostGIS postgresql qgis sarge scim skype subversion svn tomcat ubuntu utf8 westdc Windows wordpress 中文
Tag Archives: bash
批量重命名gzip包内文件
应wu要求,转换一个gz文件里的文件名称为gz文件名,而且gz包只有一个文件,其实就是解压缩,然后再压缩。 for i in *.gz;do gzip -d $i && gzip ${i%.gz};done
用shell脚本导入landuse数据到postgis
全国的土地利用数据,80年代末,1995和2000年3期数据,ARCINFO COVERAGE格式,打算直接转入POSTGIS库中。 写了一个shell文件,花费了2天时间。主要是shell的东西是边看边写的,特别是变量处理,还真是麻烦。 运行shell文件要先进入到landuse目录,postgis里应该已经有westdc库,并且已经 进行了POSTGIS初始化,导入过landuse表,并且已经增加了areacode和year字段,不能为NULL,且默认为空值。 从avcbin格式到postgis库,因为数据表的关系,作了两次转换。提出了ARCINFO中的cov#和cov-id字段。 #!/bin/sh # cd /opt/to_reback/data/landuse tmpdata=./tmpdata YEAR=”80年代末 1995年 2000年” for a in $YEAR; do for b in $a/*; do #province, 目录判断 if [ -d $b ]; then rm -fdr $tmpdata for c in $b/ld*; do … Continue reading
bash中&&和||
一直没有搞清楚在bash中这两个符号的意义。最近在学习BASH编程一书才有所了解。 使用& &的一般形式为: 命令1 && 命令2 这种命令执行方式相当地直接。& &左边的命令(命令1)返回真(即返回0,成功被执行) 后,& &右边的命令(命令2)才能够被执行;换句话说,“如果这个命令执行成功& &那么执 行这个命令” 使用| |的一般形式为: 命令1 || 命令2 | |的作用有一些不同。如果| |左边的命令(命令1)未执行成功,那么就执行| |右边的命令 (命令2);或者换句话说,“如果这个命令执行失败了|| 那么就执行这个命令”。
png convert to gif script
本来要用gda,,结果发现gdal不支持多波段转换。 只好使用Imagemagick,先安装: apt-get install imagemagick 脚本内容: #!/bins/sh for i in *.gif; do echo “convert $i to ${i%.png}.gif….”; convert $i ${i%.png}.gif ; done exit 1;