Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
newline character
Name: deeps Date: July 31, 2006 at 11:17:20 Pacific OS: unix CPU/Ram: 1gb
Comment:
Can anyone help me how do i find the size of a file in bytes.
I know -s <filename> returns the size in bytes but how do i get that in a variable.
Also, how do i equate a variable to a newline character in shell program.
For eg:
if [ "$line" == "\n" ]
Somehow the above statement doesnt work when i try to check for the newline character in my program.
Summary: :g/DATA/s/ [ ]*/CtrlVCtrlM/g For all lines containing the string DATA, the above command will change each string of spaces to a newline character. The CtrlVCtrlM are two control characters in a row: ...
Summary: Since several years, I needed time to time a filter which can remove conditionnally a newline character. Now I have the solution as in this example: test> cat in.txt | sed '/SCENE.*[^\.]$/N;s/\n *...
Summary: This depends on the sed you are using, and in what context. I believe GNU's sed can do what you tried. More traditional sed (say OSF1) cannot, yet can quote an actual newline character. This means t...