Timeline for Using sed to find and replace node version in certain files
Current License: CC BY-SA 4.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 20, 2023 at 17:21 | comment | added | terdon♦ | Well, in either case, @Kusalananda, the regex wouldn't match so nothing would happen. | |
| Mar 20, 2023 at 17:11 | comment | added | Kusalananda♦ | @terdon And (or) they are using the native sed on macOS, which treats -i differently. It's unfortunately quite unclear what "does not work at all" actually means here, so we are left guessing and trying to cover all possible ways things could possibly have gone wrong. | |
| Mar 20, 2023 at 16:44 | comment | added | terdon♦ | Kusalananda gave you the correct solution, but just FYI, sed doesn't understand \d which is a PCRE feature. So \d in sed is just the letter d and nothing else. So that's why your approach didn't work, sed was looking for nodejs followed by 0 or more d characters, then any character (.) and an x and since you have numbers after the nodejs string, that wouldn't match. | |
| Mar 20, 2023 at 15:29 | answer | added | Kusalananda♦ | timeline score: 1 | |
| Mar 20, 2023 at 15:22 | comment | added | schrodingerscatcuriosity | @JJoao Although the dot in nodejs[0-9]*.x would match the dot given OP's example, in the regex context it means any character, but what needs to be matched is a literal dot, so it should be nodejs[0-9]*\.x. | |
| Mar 20, 2023 at 14:21 | comment | added | xerxes | @Kusalananda yes | |
| Mar 20, 2023 at 14:21 | history | edited | xerxes | CC BY-SA 4.0 | added 194 characters in body |
| Mar 20, 2023 at 14:15 | comment | added | Kusalananda♦ | Is this a structured document written in HCL? | |
| Mar 20, 2023 at 14:06 | history | edited | xerxes | CC BY-SA 4.0 | added 194 characters in body |
| Mar 20, 2023 at 14:05 | history | edited | xerxes | CC BY-SA 4.0 | added 194 characters in body |
| Mar 20, 2023 at 12:35 | history | asked | xerxes | CC BY-SA 4.0 |