Post History
I have the following problems working with sed: It doesn't allow multiline operations (thus, no indentations, no nesting) It is generally obligatory to wrap entire commands in quote marks (sed ...
#4: Post edited
- I have the following problems working with `sed`:
- * It doesn't allow multiline operations (thus, no indentations, no nesting)
* It is generally obligatory to wrap entire commands in quote marks (`sed "SED_COMMAND"` FILE) even if the command itself contains quote marks.- Without these problems I could format a long liner such as `sed -i "s/\$to = ".*";$/\$to = example@example.com;/g" PATH` as in this pseudocode:
- ```shell
- sed -i
- A
- \$to = ".*";$
- B
- \$to = example@example.com;
- G
- PATH
- ```
- * A means "from"
- * B means "to"
- * G means "global"
- Since `sed` doesn't work this way, how could I achieve a similar syntax in the shell? Perhaps by using Python? Perl? Something else?
- I have the following problems working with `sed`:
- * It doesn't allow multiline operations (thus, no indentations, no nesting)
- * It is generally obligatory to wrap entire commands in quote marks (`sed "SED_COMMAND" FILE`) even if the command itself contains quote marks.
- Without these problems I could format a long liner such as `sed -i "s/\$to = ".*";$/\$to = example@example.com;/g" PATH` as in this pseudocode:
- ```shell
- sed -i
- A
- \$to = ".*";$
- B
- \$to = example@example.com;
- G
- PATH
- ```
- * A means "from"
- * B means "to"
- * G means "global"
- Since `sed` doesn't work this way, how could I achieve a similar syntax in the shell? Perhaps by using Python? Perl? Something else?
#3: Post edited
- I have the following problems working with `sed`:
- * It doesn't allow multiline operations (thus, no indentations, no nesting)
* It is generally obligatory to wrap entire commands in quote marks (`sed "SED_COMMAND"` FILE) even if the command itself contains quote marksWithout these problems I could format a long liner such as `sed -i "s/\$to = ".*";$/\$to = example@example.com;/g" PATH` as something like this pseudocode:- ```shell
- sed -i
- A
- \$to = ".*";$
- B
- \$to = example@example.com;
- G
- PATH
- ```
- * A means "from"
- * B means "to"
- * G means "global"
Since `sed` doesn't work this way, how could I achieve a similar code in the shell? Perhaps by using Python? Perl? Something else?
- I have the following problems working with `sed`:
- * It doesn't allow multiline operations (thus, no indentations, no nesting)
- * It is generally obligatory to wrap entire commands in quote marks (`sed "SED_COMMAND"` FILE) even if the command itself contains quote marks.
- Without these problems I could format a long liner such as `sed -i "s/\$to = ".*";$/\$to = example@example.com;/g" PATH` as in this pseudocode:
- ```shell
- sed -i
- A
- \$to = ".*";$
- B
- \$to = example@example.com;
- G
- PATH
- ```
- * A means "from"
- * B means "to"
- * G means "global"
- Since `sed` doesn't work this way, how could I achieve a similar syntax in the shell? Perhaps by using Python? Perl? Something else?
#2: Post edited
substituting text in a sed like manner but with a richer format
- Substituting text in a sed like manner but with a richer format
#1: Initial revision
substituting text in a sed like manner but with a richer format
I have the following problems working with `sed`: * It doesn't allow multiline operations (thus, no indentations, no nesting) * It is generally obligatory to wrap entire commands in quote marks (`sed "SED_COMMAND"` FILE) even if the command itself contains quote marks Without these problems I could format a long liner such as `sed -i "s/\$to = ".*";$/\$to = example@example.com;/g" PATH` as something like this pseudocode: ```shell sed -i A \$to = ".*";$ B \$to = example@example.com; G PATH ``` * A means "from" * B means "to" * G means "global" Since `sed` doesn't work this way, how could I achieve a similar code in the shell? Perhaps by using Python? Perl? Something else?