nsbin/old/replace-old-files

15 lines
260 B
Text
Raw Normal View History

2006-07-20 07:54:37 +00:00
FILE=/tmp/replace-`date +%s`
OLD_STRING=/usr/old-files/bin
NEW_STRING=/usr/bin
if [ $# -ne 1 ]; then
echo neo
exit 1
fi
if [ `grep "$OLD_STRING" "$1"` ]; then
echo "$1"
cat "$1" | sed "s,$OLD_STRING,$NEW_STRING,g" > "$FILE"
mv "$FILE" "$1"
fi