Timeline for sed stripping comments inline
Current License: CC BY-SA 4.0
22 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 17, 2020 at 8:47 | history | edited | αғsнιη | CC BY-SA 4.0 |
deleted 31 characters in body
|
| Jan 27, 2020 at 8:10 | answer | added | pointbazaar | timeline score: 0 | |
| Aug 6, 2017 at 2:37 | answer | added | user218374 | timeline score: 0 | |
| Aug 4, 2017 at 20:38 | answer | added | Stéphane Chazelas | timeline score: 6 | |
| Aug 4, 2017 at 19:45 | comment | added | rimraf | no. same problem. only pulls single lines and not the inline ones. I just found gnu-sed on homebrew. I will try this now. | |
| Aug 4, 2017 at 19:41 | comment | added | B Layer |
My version doesn't work? I'm not using any extensions that I'm aware of...just baseline sed features.
|
|
| Aug 4, 2017 at 19:41 | comment | added | rimraf | oh. good idea. I will try this now. As far as accomplishing the same task with another tool, maybe more universal? do you have any suggestions? Maybe doing something with regex perhaps? i dunno. I will try to update my sed with homebrew like you suggested. | |
| Aug 4, 2017 at 19:39 | comment | added | B Layer |
On OSX the default version of many tools are older, less capable. Install GNU Utils .. you can use brew or whatever it's called (I don't use macs). This is for sed, grep, awk, find. etc. etc. apple.stackexchange.com/questions/69223/…
|
|
| Aug 4, 2017 at 19:38 | comment | added | rimraf |
And pow! this is the problem. I am running on os x. sed --version throws an error. I seem to recall having a similar problem a few years ago. It's all coming back to me. Looks like i need to come up with another method for os x....
|
|
| Aug 4, 2017 at 19:36 | comment | added | B Layer |
It may be that the online version is only POSIX. That is, it doesn't have GNU extensions or anything. Did you try my version online? I tried to avoid any extensions. In fact when I run each of them with GNU sed's --posix flag mine still works but the other behaves exactly as you describe.
|
|
| Aug 4, 2017 at 19:34 | comment | added | αғsнιη |
@archae0pteryx Which version of sed --version are you using? try with sed -E -e 's:(\s+(//|#)|^\s*(//|#)).*$::' -e '/^$/d' infile.txt once
|
|
| Aug 4, 2017 at 19:22 | comment | added | rimraf |
lets see here. Nope they both pass no problem but the inline ones console.log(something) // some comment still are not being removed (locally that is. like i said it works perfectly with an online shell) My only guess is maybe different versions of sed? That's my best guess at least... thoughts?
|
|
| Aug 4, 2017 at 19:12 | history | edited | rimraf | CC BY-SA 3.0 |
added 356 characters in body
|
| Aug 4, 2017 at 18:57 | history | edited | rimraf | CC BY-SA 3.0 |
added 356 characters in body
|
| Aug 4, 2017 at 17:05 | comment | added | Stéphane Chazelas |
What about lines that have const url = 'http://stackexchange.com' or const x = '###'?
|
|
| Aug 4, 2017 at 17:00 | history | edited | αғsнιη | CC BY-SA 3.0 |
edited title
|
| Aug 4, 2017 at 16:38 | history | edited | Philippos | CC BY-SA 3.0 |
It's sed. SED was the party to ruin eastern Germany
|
| Aug 4, 2017 at 16:19 | answer | added | B Layer | timeline score: 3 | |
| Aug 4, 2017 at 16:18 | history | edited | αғsнιη |
edited tags
|
|
| Aug 4, 2017 at 15:42 | comment | added | rimraf | that removes the whole line. | |
| Aug 4, 2017 at 15:37 | review | First posts | |||
| Aug 4, 2017 at 15:44 | |||||
| Aug 4, 2017 at 15:35 | history | asked | rimraf | CC BY-SA 3.0 |