#!/bin/bash
strB='parcel-repo'
for FILE in /etc/alternatives/*
do
#echo $FILE
#echo $(ls -l $FILE | awk '{print $11}')
target_file=$(ls -l $FILE | awk '{print $11}')
#echo $target_file
if [[ $target_file == *$strB* ]];then
#echo $target_file
echo $target_file;target_file=${target_file/parcel-repo/parcels};ln -snf $target_file $FILE
fi
done
shell脚本将目录下的所有软链接进行批量替换
最新推荐文章于 2022-06-03 21:15:34 发布