Initial commit
This commit is contained in:
commit
d3c6e29902
202 changed files with 3909 additions and 0 deletions
14
replace-old-files
Executable file
14
replace-old-files
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue