工作中遇到jar包漏洞问题,需要批量更换,减少不少工作量和错误概率
#!/bin/bash
suffix=".bak"
source="/home/hdfs/opt/test.sh"
for file in `find /home/hdfs/opt/ -type f -name 'pyflink.zip'`
do
newfile=`echo $file$suffix`
echo $file
mv $file $newfile
target=`dirname $file`
echo $path
cp $f $path
done