#! /bin/bash
read file1 file2
if [ -f $file1 -a -f $file2 ]&&[ $file1 -nt $file2 ]
then
cat $file1 > $file2
elif [ -f $file1 -a -f $file2 ]&&[ $file2 -nt $file1 ]
then
cat $file2 > $file1
elif [ -f $file1 -a -d $file2 ]
then
mv $file1 ./$file2
elif [ -d $file1 -a -f $file2 ]
then
mv $file2 ./$file1
else
echo nothing
fi
【利用LINUX下的SHELL命令实现文件操作】
于 2023-02-24 19:59:02 首次发布