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

filenames with spaces no longer error #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jamestomasino
Copy link

Rather than getting column 2, I get column 2 to the end of the line. Spaces in filenames are handled properly.

Review on Reviewable

@jamestomasino
Copy link
Author

This seems to fix the basic operation, but it's not fixing things when you use the -f option. Even so, if passing files with spaces as arguments, you might want to escape the spaces as well. A little sed magic could fix that up.

@cmaitchison
Copy link
Owner

Hi James. Thanks for the fix! I'm going to have to update the test-repo with some files with spaces in them before I can merge in your pull request. Time is a bit tight for me right not, but if you are interested in doing that please feel welcome.

Filenames are trimmed, spaces escaped. The output methods were pruned and use awk more. Header row on output added at the end, if needed.
@jamestomasino
Copy link
Author

I did a bunch more work on it, getting awk in there all over the place. I think I've got it working in all your use cases, but I haven't update the tests to really see. When one of us gets a chance, I think we'll know for sure.

@jamestomasino
Copy link
Author

One final note. In your final example:

 find_fattest_objects.sh -n50 -d -f | xargs purge_objects.sh 

To support spaces, xargs will require the -0 argument.

 find_fattest_objects.sh -n50 -d -f | xargs -0 purge_objects.sh 

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

Successfully merging this pull request may close these issues.

2 participants