sed problems with append command a\

sed problems with append command a\

Post by Roland Reichenber » Thu, 03 Jul 2003 02:36:11



Hi NG,

I want to add a config variable to several config files using the sed.

I have the following sed-script "my_sed_script":
$a\
VAR=new_variable

So I call the sed like this:

This works fine. So I want to insert this sed-call in a bash script that
finds all necessary config files and appends the variable. But in the bash
script I have have a sed problem with the following call:

The sed says:
sed: -e expression #1, char 4: Extra characters after command.

What is going wrong? I have tried to escape the '\' wihtout success.

Thanks in advance,

    Roland

 
 
 

sed problems with append command a\

Post by Barry Margoli » Thu, 03 Jul 2003 03:08:58




>I want to add a config variable to several config files using the sed.

Please don't multi-post.  I just answered this in another newsgroup
(comp.unix.questions, I think).

What does this have to do with system administration, anyway?
comp.unix.questions was the perfect group for it.

--

Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. sed problem with append command a\

Hi NG,

I want to add the string "hallo world" to text file using the sed.

I have the following sed-script "my_sed_script":
$a\
hello world

So I call the sed like this:

This works fine.

But I have a sed problem with the following call:

The sed says:
sed: -e expression #1, char 4: Extra characters after command.

What is going wrong? I have tried to escape the '\' wihtout success.

Thanks in advance,

    Roland

2. Anyone want my free Newbie's Linux Manual?

3. SED - the append command

4. password expires after using admintool

5. sed: command line syntax for append

6. APIC Errors: how I fixed them

7. SED append command

8. comp.os.multiple.advocacy

9. sed: command line syntax for append

10. replace gnu sed command ~ with sed command

11. String manipulation error & how to use sed in a sed command?

12. Appending to a line with Sed

13. appending output using sed ?