Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using boxes makes output hard to grep #20

Open
thsutton opened this issue Nov 23, 2016 · 2 comments
Open

Using boxes makes output hard to grep #20

thsutton opened this issue Nov 23, 2016 · 2 comments

Comments

@thsutton
Copy link

Using boxes for du hh output makes it hard to grep the output due to the right padding.

Here's a contrived shell session.

$ hh du /some/directory
1G /some/directory/ABC/
1G /some/directory/A/
1G /some/directory/B/
1G /some/directory/C/
$ hh du /some/directory | egrep '/[A-Z]/$'
$ hh du /some/directory | hexdump -C
00000000  31 47 20 2f 73 6f 6d 65  2f 64 69 72 65 63 74 6f  |1G /some/directo|
00000010  72 79 2f 43 2f 20 20 0a                           |ry/C/  .|
$ hh du /some/directory | egrep '/[A-Z]/ *$'
1G /some/directory/A/
1G /some/directory/B/
1G /some/directory/C/
$
@jacobstanley
Copy link
Owner

@thsutton maybe it's enough for us to just trim the whitespace of the end of each line?

@thsutton
Copy link
Author

Yeah, should be. Something like

s/printBox/unlines . fmap (dropWhileEnd (`elem` " \t")) . lines . render/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants