Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Dear Pan,
Thanks for your answer.
Unfortunately, there is no relation between this issue and the carriage return point.
Indeed, I had to copy paste from a linux guest host by a windows running virtual box, hence the \n in my forum message.
Cheers
Sylvain
one gave me a sed script file filter.sed which starts with the 3 following blocks :
Code:
/Setting env. variables.
*$/,/BUILD: .*
*$/d
/^WARNING: .* logout and login .*
*$/,/^=*
*$/d
/All Rights Reserved.
*$/,/See error log file for details.
*$/d
A newline is the end of a command for sed, except if you put a backslash before it. Backslashes remove the special meaning of characters, and the newline becomes an ordinary character, not a line delimiter.
I tried it like this directly on the command line:
Code:
$ echo bla | sed '/Setting env. variables.\
*$/,/BUILD: .*\
*$/d'
bla
$ echo -e 'Setting env. variables,\n\n\n' | sed '/Setting env. variables.\
*$/,/BUILD: .*\
*$/d'
Last edited by berndbausch; 12-18-2018 at 03:46 AM.
Dear Pan,
Thanks for your answer.
Unfortunately, there is no relation between this issue and the carriage return point.
Indeed, I had to copy paste from a linux guest host by a windows running virtual box, hence the \n in my forum message.
Cheers
Sylvain
If there are \n at the end of the lines it prints the error message (what you got).
If I replace \n to \r it will work.
@ Pan64 : Many thanks for this precision.
My mistake was to use visual code to edit the sed script file.... When I edit the sed script file with vi, I can see that the 3 first lines are actually one and only one line, each of its 3 chunks are separated by the special char ^M (CR), which is not the native linux carriage return. Furthermore, ^M is misinterpreted by sed.
Removing the ^M makes the job !
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.