Skip to content

Commit

Permalink
missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveorevo committed Nov 16, 2023
1 parent 84e854e commit a38fda8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions link_rename.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#! /bin/bash

DIR=$1
OLD_PATTERN=$2
NEW_PATTERN=$3

while read -r line
do
echo $line
CUR_LINK_PATH="$(readlink "$line")"
NEW_LINK_PATH="$CUR_LINK_PATH"
NEW_LINK_PATH="${NEW_LINK_PATH/"$OLD_PATTERN"/"$NEW_PATTERN"}"
rm "$line"
ln -s "$NEW_LINK_PATH" "$line"
done <<< $(find "$DIR" -type l)

0 comments on commit a38fda8

Please sign in to comment.