You are not logged in.
Pages: 1
I am basically asking, something in continuation to this:
http://dev1galaxy.org/viewtopic.php?id=6857
How can I replace all mentions instead of a word instead of searching for it.
Through all of a git folders/repo
Last edited by zapper (2024-10-02 16:40:06)
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
From the root of the git repo:
find . -type f -exec sed -i 's/old-word/new-word/g' {} \;
Be careful with your words! (e.g. don't change a word that might be part of a word that's not the intended word.)
Offline
You are giving zapper a loaded gun to play with?! Oh my!!!
Online
@golinux which is why I am replacing python2.7 with tauthon instead of python with tauthon
;P
Btw, I used this command after doing that:
git rev-list --all | xargs git grep -F python2.7
and it still shows python2.7 mentions... weird stuff.
Correcting what I said, I wrote down the wrong one.
Last edited by zapper (2024-10-02 20:34:29)
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
You said, "I used this command after doing that."
I ask, "What did you do before you ran that 'find' command?" It should have worked.
Offline
In simple terms, I did this:
find . -type f -exec sed -i 's/old-word/new-word/g' {} \;
Then I did my command to check to see if it was fixed,
git rev-list --all | xargs git grep -F python2.7
I seem to have gotten mixed up and written wrong thing down... my bad.
In any case, that might help clear up the confusion.
Does the find command you gave me actually replace all mentions of the word python2.7 if I put it as first word with the second word in all source code?
Or am I really confused.
Last edited by zapper (2024-10-02 20:33:33)
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
Yes you are confused .
That find command of @fsmithred, when taken literally, will replace all occurrences of "old-word" (literally) with "new-word" (literally), and it will do nothing to occurrences of "python2.7".
That is a puzzle for ome and not for others.
Offline
Yeah, you have to tell sed exactly what to find and replace.
find . -type f -exec sed -i 's/python2.7/tauthon/g' {} \;
Offline
@fsmithred hmm... weird I tried that and it still left stuff behind unchanged...
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
The command you are using,
git rev-list --all | xargs git grep -F python2.7
scans all versions of all files in reverse chronological order, to find "python2.7".
Probably you mean to only check the latest version of the files? Like
grep -F python2.7 -r *
which would not report any match.
Offline
@ralph.ronnquist fair point hmm....
Yeah, it must keep resetting... then. I am doing something a bit out of the norm anyhow for here.
So I will leave it at that.
Last edited by zapper (2024-10-03 07:47:10)
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
Pages: 1