Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SED.EXE Bug?
# 1  
Old 10-12-2001

Hi all,
when using sed to replace a piece of text multiple times in a file something weird happens.If there is no carriage return after the last line in the file it deletes the line. Anyone know why ?


command line :
sed -e "s/System.out.println/\/\/Commented out by us System.out.println/g" d:\sed\source.txt
# 2  
Old 10-16-2001
can u tell what OS u r working on?
it seems like MSDOS or Windows to me!
# 3  
Old 10-17-2001
unix. Although I have seen the same thing happeneing on windows Sed.exe
# 4  
Old 10-17-2001
Sed works on lines. It always ignores a partial line at the end of the file. This is documented in the first paragraph of the description on the sed man page.
# 5  
Old 10-17-2001
ok, that makes sense. Annoying, but its makes sense Smilie
Could you recommend a stream editor that doesn't do this?
I've got a client localising deployment property files with sed.
This led to an issue where the last line was being stripped and the system started throwing a fit.

Thanks for your help
# 6  
Old 10-18-2001
Would it be feasable to do something like this?:
echo "\012" >> file ; sed [...]

That should place a < LF > at the end of a file before sed gets to it...
# 7  
Old 10-18-2001
well pardon me if i were wrong!

I was trying to reproduce the same, but i did not find such a problem, eventhough i have encountered the same with some other compilers.

can anyone tell me how to chech whether there is end of line character in each line in a file?

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming


hello everyone, could somebody tell me where can i find some good exercises on signals,processes and threads? actually i need to find some solved exercises in system programming. tnx (4 Replies)
Discussion started by: micy
4 Replies

2. Programming

How to build .exe from c

All, I have never comipled C code before and would appricaite if anyone could tell me how to build a .exe from a C program. Thanks in advance. (5 Replies)
Discussion started by: thana
5 Replies

3. Programming


Is it possible to extract c program,from its executable file(.exe)? i mean we dont have program but its exe file only which runs,can we retrieve the program? if yes how? if no why? (2 Replies)
Discussion started by: unknown9
2 Replies

4. UNIX for Dummies Questions & Answers

.exe files

how to open .exe file in freebsd system.My work is to run a growth.exe(created by growth.c turbo c 3.0 file).how to run that exe file in freebsd system?Thanks in advance help me (8 Replies)
Discussion started by: kumarangopi
8 Replies

5. Linux

How to run .exe

Hai, is there any way to run an .exe file in unix environment . i have read that WINE HQ supports this concept but its very inconsistent and upto the user risk . but i tried WINE but iam not able to configure it can any one help me in this matter Regards Sanju (1 Reply)
Discussion started by: sanjustudy
1 Replies

6. SuSE

does exe

does exe files works withe suse am new n linux system and were can i find msn 4 linux (2 Replies)
Discussion started by: abdulla
2 Replies

7. Programming

how To edit exe to insert a serial no wich can be usd by runing exe

At time of installation I have to open the resource. and i have to insert a string serial number in the exe. please provide me code to edit the exe (in solaris) to insert a serial number which can be used by exe at run time. (6 Replies)
Discussion started by: ssahu
6 Replies

8. UNIX for Dummies Questions & Answers

Sed bug in OS X?

I've been playing around with sed for a few days now and find that regular expressions never work inside sed s/// on Mac OS 10.2.5. Has anyone else bumped up against this problem? For example, the "sed" segment of the following always fails no matter how items are escaped: cd... (12 Replies)
Discussion started by: ktoz
12 Replies

9. UNIX for Advanced & Expert Users

.exe file

Hello all, how to run windows .exe file in Linux and vice the versa (3 Replies)
Discussion started by: rajashekaran
3 Replies
Login or Register to Ask a Question