#!/bin/bash olddir=/home/img/luimg newdir=/home/img/luimg/thumb while read line do if [ -f $olddir${line%.*}.jpg ] then rm -f $olddir${line%.*}_375_0.jpg #ls $olddir${line%.*}_375_0.jpg #ls $newdir${line%.*}* rm -f $newdir${line%.*}* fi done < lu.txt
chapter10 文件和异常 10.1 从文件中读取数据 10.1.1 读取整个文件 with open("pi.txt") as file_object: contents = file_object.read() print(contents) print(contents.rstrip())//去掉空白行 10.1.2 文件路径 10.1.3 逐行读取 filename = 'pi.txt' with open(filename) as file_object: for lin