QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2472|回复: 2

我的shell错在哪里?

[复制链接]
发表于 2007-3-17 12:55:28 | 显示全部楼层 |阅读模式
我需要更改一批文件的分辨率,有400多个,用下面的shell来做,
for i in *; do convert $i -resize 64x64 $i; done
不少文件名可能都有空格,结果只能更改几个文件后命令就僵死了。
convert: missing an image filename `X..png'.
convert: unable to open image `CD': No such file or directory.
convert: unable to open image `ROM.png': No such file or directory.
convert: unable to open file `ROM.png'.
convert: unable to open image `CD': No such file or directory.
convert: missing an image filename `ROM.png'.
==================================
再列几个文件名

Computer Blue Dalmation.png         @ Icon Aqua.png                        My Documents (globe).png                System iTools.png
Computer Ti Book Front.png          Icon Aqua.png                          My Music (globe).png
发表于 2007-3-17 13:13:10 | 显示全部楼层
用双引号括起来不行吗?
回复

使用道具 举报

 楼主| 发表于 2007-3-17 14:09:11 | 显示全部楼层
for i in *; do convert "$i" -resize 64x64 "$i"; done
可以了,老大能不能介绍一本学习shell的书籍,我是文科的,学习shell有点不着边际。
还有一个文件无法改,就是一@开头的一个文件,文件名:@ Icon Aqua.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-18 22:07 , Processed in 0.077170 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表