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

Usage with xargs #53

Open
Gary-Armstrong opened this issue May 1, 2024 · 1 comment
Open

Usage with xargs #53

Gary-Armstrong opened this issue May 1, 2024 · 1 comment

Comments

@Gary-Armstrong
Copy link

I'm trying to do this:

xargs -0 -P $parallel -I {} sh -c "{ date '+START {} %Y-%m-%d_%H:%M:%S' >> $logf; \
	bytes=$(diskus -v {}); \
        echo "{},$bytes" >> $csvf; \
	date '+FINISH {} %Y-%m-%d_%H:%M:%S' >> $logf; }"

But:

diskus: could not retrieve metadata for path '{}'

I'm 96% sure my xargs is correct since I'm just replacing du with diskus in the same construct. The {} comes out as expected elsewhere. Any ideas?

@sharkdp
Copy link
Owner

sharkdp commented May 5, 2024

If diskus sees "{}" as a literal argument, then something is wrong with your command.

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