Substitute newline with tab at designated field separator

Shell Programming and Scripting




Kindly Note - This is a Single User Post by Forum Member hanson44 Regarding:
Substitute newline with tab at designated field separator.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old 04-02-2013
hanson44 hanson44 is offline
Registered User
 
Be happy to. l (ell, not one) is a basic sed command that helps diagnose what is going on. l (ell) prints the pattern space in a special format, for debugging. l (ell) is never (or extremely rarely) used for production scripts.

So in the example, l (ell) is showing what the pattern space looks like immediately before running the s (substitute) command. It shows the embedded \n characters that N introduced at each step. It also shows a $ at the end of the line. There is not really a $ there. It is just part of the special display format of the l command, to mark the end of the pattern space.

I think the mnemonic for l is "line", or maybe "list". Not sure.

BTW, if pattern space if long, l (ell) will wrap at 70 characters, which is usually not desirable. You could use "l 0" to run the l command without word wrapping.
The Following User Says Thank You to hanson44 For This Useful Post:
yifangt (04-02-2013)