Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
1 answer
96 views

I'm trying with GNU sed command to append a line into a file inside a block/section, specifically just a line under the start of the block/section. As a result it empties the file (maybe leaves a ...
0 votes
0 answers
67 views

I don't understand the behavior of the backslash in the a command in gnu sed. The version of gnu sed used is 4.9. $ gsed --version gsed (GNU sed) 4.9 Copyright (C) 2022 Free Software Foundation, Inc. ...
ysdkk923's user avatar
-1 votes
1 answer
48 views

Given that echo -e 'one.onetwo' | sed -n 's/\(.*\)\.1円/x/p' prints xtwo, why does the following print onextwo? echo -e 'one.two' | sed -n 's/\(.*\)\.1円/x/p'
Enlico's user avatar
  • 30.3k
1 vote
3 answers
135 views

I am looking for a sed command to match pattern and copy pattern line and n number of lines after this line. pattern is 01, 02, 03 sequence. Example: group-title=01- line1 http://www.yahoo.com group-...
1 vote
1 answer
97 views

I want to try to find between patterns substrings then replace it Source example text: bbllaahh pattern1 blaah _SUBSTRING_ blah blaah bbblah bbllaahh pattern1 blah blaah _SUBSTRING_ blahh _SUBSTRING_ ...
1 vote
1 answer
1k views

Can I put comments (or something functionally equivalent) into a sed command file? subs.sed s/this/that/g # comment s/it/they/g $ sed -i -f subs.sed <(echo this it) that they
user avatar
6 votes
1 answer
4k views

I wrote the following command echo -en 'uno\ndue\n' | sed -E 's/^.*(uno|$)/1円/' expecting the following output uno This is indeed the case with my GNU Sed 4.8. However, I've verified that BSD Sed ...
Enlico's user avatar
  • 30.3k
3 votes
2 answers
170 views

I consider my self pretty good with regular expressions, but this one is appearing to be surprisingly tricky. I want to trim all whitespace, except the ones between "" and [] characters. I ...
Bek's user avatar
  • 271
1 vote
1 answer
203 views

How can I insert a line before each multiline range block and indent the blocks in gnu sed on windows? The files contain many code blocks of various length starting and ending with ```. Answers to ...
flywire's user avatar
  • 1,435
-1 votes
1 answer
186 views

Suppose we have a block of lines as given example below: <segment1> <element="1" prop="blah"/> <element="2" prop="blah"/> . . &...
2 votes
2 answers
87 views

With this command I am trying to insert M09 between two patterns of M502 and the second line since M502 that looks like X41.5Y251.5T201. Specifically I am trying to insert M09 before the last line. ...
0 votes
1 answer
460 views

This is mostly a curiosity question that arose here. From the man page of GNU sed 4.8 I read --posix disable all GNU extensions. so I understand that if a code like the ...
Enlico's user avatar
  • 30.3k
0 votes
2 answers
167 views

I want to copy a given text file (on macOS or Unix in general) to stdout where to any { and : character a newline is added. I tried sed "s/{/{\n/g" myfile.txt Just for the curly bracket character, ...
2 votes
1 answer
225 views

I need to remove an extra pipe character at the end of header row of a pipe delimited csv file with sed. The literal string that I am trying to find is COLNAME| Working on a GCP Windows server. The ...
2 votes
3 answers
131 views

I have a urlwatch .yaml file that has this format: name: 01_urlwatch update released url: "https://github.com/thp/urlwatch/releases" filter: - xpath: path: '(//div[contains(@class,&...
John's user avatar
  • 516

15 30 50 per page
1
2 3

AltStyle によって変換されたページ (->オリジナル) /