next code doesnt work because of spaces in file names, How to fix?
IFS = '
'
for name in `ls `
do
number=`echo "$name" | grep -o "[0-9]{1,2}"`
if [[ ! -z "$number" ]]; then
mv "$name" "./$number"
fi
done
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…