Skip to content

Instantly share code, notes, and snippets.

@bfrancom
Created July 14, 2023 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bfrancom/e4f6b4e846a7921039075a84a862811a to your computer and use it in GitHub Desktop.
Save bfrancom/e4f6b4e846a7921039075a84a862811a to your computer and use it in GitHub Desktop.
replace a URL for an image
#!/bin/bash
input="/tmp/realImages.txt"
while IFS= read -r line
do
bob=$(basename $line)
find . -type f -exec sed -i '' -e "s,$line,/images/old/$bob,g" {} \;
done < "$input"
#while read line
#find . -type f -exec sed -e "s/$line/2010/g" {} \;;done < /tmp/realImages.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment