bash - What does the `l` option mean in GNU sed? -


i have read sed manual -l command. there says:

-l --line-length=n 

specify default line-wrap length l command. length of 0 (zero) means never wrap long lines. if not specified, taken 70.

i don't know how useful. can give me example?

i think this,but result:

[root@kvm ~]# echo 'abcdefg' | sed -l 3  -n '/a/p' abcdefg 

from sed manual:

commands accept address ranges

...

l list out current line in ``visually unambiguous'' form.

l width list out current line in ``visually unambiguous'' form, breaking @ width characters. gnu extension.

the -l n, --line-length=n option allows specify desired line-wrap length 'l' command (when wrap-width argument not explicitly provided in sed script).

$ echo abcdefgh | sed -n 'l 5' abcd\ efgh$ $ echo abcdefgh | sed -n -l 5 'l' abcd\ efgh$ $ echo abcdefgh | sed -n -l 5 'l 3' ab\ cd\ ef\ gh$ 

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -