#!/bin/bash ls $1 | more > /home/spyda/Documents/tmp.txt cat /home/spyda/Documents/tmp.txt while read old_filename;do mv $old_filename $old_filename.txt echo "$old_filename.txt" done < /home/spyda/Documents/tmp.txt 2>&1 rm /home/spyda/Documents/tmp.txt exit 0 |
mv: cannot stat `5.30': No such file or directory
5.30.txt
mv: cannot stat `5.31': No such file or directory
5.31.txt
mv: cannot stat `6.10': No such file or directory
6.10.txt
mv: cannot stat `6.11': No such file or directory
6.11.txt
mv: cannot stat `6.15': No such file or directory
6.15.txt
mv: cannot stat `6.2': No such file or directory
6.2.txt
mv: cannot stat `6.21': No such file or directory
6.21.txt
mv: cannot stat `6.3': No such file or directory
6.3.txt
mv: cannot stat `6.4': No such file or directory
6.4.txt
mv: cannot stat `6.6': No such file or directory
6.6.txt
mv: cannot stat `6.7': No such file or directory
6.7.txt
mv: cannot stat `6.8': No such file or directory
6.8.txt
mv: cannot stat `6.9': No such file or directory
6.9.txt
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |