You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An 'empty' line is "" or really \n or \r\n or \r,
as iterated by e.g. file.__iter__.
## The outputs here are all equivalent:# (echo -e "here\n\n"; ls -a) | pyline# (echo -e "here\n\n"; ls -a) | pyline 'l'
$ (echo -e "here\n\n"; ls -a) | pyline 'l and l'
here
.
..
These all output no lines and return 0; because
pyline does strip out values that eval to False with Python bool() after an expression; e.g.:
$ (echo -e "here\n\n"; ls -a) | pyline 'l and ""'
$ (echo -e "here\n\n"; ls -a) | pyline 'l and False'
$ (echo -e "here\n\n"; ls -a) | pyline 'l and None'
TODO
Is this a bug?
It could be configurable. e.g. --print-null, -no-strip-empty
Options:
[-], --strip-empty-lines, --strip-empty
[-], --no-strip-empty-lines, --no-strip-empty
The text was updated successfully, but these errors were encountered:
These all output no lines and return 0; because
pyline does strip out values that eval to
False
with Pythonbool()
after an expression; e.g.:
TODO
Is this a bug?
It could be configurable. e.g.
--print-null
,-no-strip-empty
Options:
-
],--strip-empty-lines
,--strip-empty
-
],--no-strip-empty-lines
,--no-strip-empty
The text was updated successfully, but these errors were encountered: