?
Solved

Getting sed : command garbled

Posted on 2006-06-25
6
Medium Priority
?
1,346 Views
Last Modified: 2008-03-17
Hello Dear

When I run  a sed script
 I am getting following erra when runnining the replacement


sed: command garbled: s/LINKFLAGS      = -G -mt -o/LINKFLAGS      = -G -mt/

Any hlep would be greatly appraciated

Thanks
Shawkat
0
Comment
Question by:dmshawkat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 16980577
Hi dmshawkat,

Are you enclosing this string in single quotes?



Kent
0
 

Author Comment

by:dmshawkat
ID: 16980603
What is the format or syntax ; where is the start and end of single quote ?

also I am running  sed -f test.sed $file > $file.out as a result I am geeting .out file

( which is the expected output ) but i have to mannually rename them to the original filename
then remove all*.out

is there a way I can overwrite the original one ?
0
 
LVL 12

Accepted Solution

by:
tel2 earned 100 total points
ID: 16982354
Hi dmshawkat,

So, you have 2 different sed commands which you have problems with, right?

1. For the one you specified in your original question, what is the exact command you're using?  (Please always include this kind of info so we can efficiently help resolve such issues).

2. For the one you specified in your 2nd question, I don't know of any way to get sed to do an "in-line" replacement.  The best I can offer, if you're wanting to do it in a single entry on the command line, is by putting 2 commands on 1 line, like this:
    sed -f test.sed $file > $file.out ; mv $file.out $file
If it's in a script, you can do that, or just put them on separate lines.
Alternatively, Perl can do in-line replacements on UNIX, so if you're happy to have a Perl solution, show us the contents of the test.sed file, and we may be able to convert it for you.
0
 
LVL 3

Assisted Solution

by:anumalas
anumalas earned 100 total points
ID: 17097335
Hello

I think

sed -f test.sed $file > $file.out ;
mv $file.out $file;

will work fine

sed will not update the file it will displays output to standard output or some output file  

I have same problem prior i have solved my problem with the above way. and onemore thing is that it will not occupy any file system space...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question