由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - 求助一个shell script
相关主题
为什么我就是不会写Shell script?Shell Script
[转载] a question about shell scriptHow to set environment variables for CGI scripts?
shell script for "for" loophow to convert csh shell script to dos batch file
shell script questiona question in shell script
[转载] 简单问题 -- about shell scriptHelp! shell programming
which shell is best?Shell Script Question about Hostname
shell programmingShell Script Question
where can I find some good website for C Shell ?Help on shell script
相关话题的讨论汇总
话题: sxc话题: script话题: shell话题: mv话题: 文件夹
进入Unix版参与讨论
1 (共1页)
j***y
发帖数: 2074
1
有一堆扫描后产生的文件夹,名字叫DOC000.XSM, DOC001.XSM, DOC002.XSM...,每个
文件夹里面的图像文件只有一个,都叫0000001.JPG,我创建了一个目录,比如叫sxc,
能否写一个script,起到如下的作用:
mv DOC000.XSM/0000001.JPG sxc/001.jpg
mv DOC001.XSM/0000001.JPG sxc/002.jpg
mv DOC002.XSM/0000001.JPG sxc/003.jpg
...
谢了先。
n****n
发帖数: 104
2
#!/usr/bin/bash
for i in {0..9}
do
src=DOC00$i.XSM/0000001.JPG
j=`expr i + 1`
dst=sxc/00$j
mv $src $dst
done
1 (共1页)
进入Unix版参与讨论
相关主题
Help on shell script[转载] 简单问题 -- about shell script
[转载] Re: shell script questionwhich shell is best?
Korn shell scriptshell programming
help shell script (waiting on line)where can I find some good website for C Shell ?
为什么我就是不会写Shell script?Shell Script
[转载] a question about shell scriptHow to set environment variables for CGI scripts?
shell script for "for" loophow to convert csh shell script to dos batch file
shell script questiona question in shell script
相关话题的讨论汇总
话题: sxc话题: script话题: shell话题: mv话题: 文件夹