Skip to content

Instantly share code, notes, and snippets.

@wtnabe
Created November 7, 2011 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wtnabe/1344386 to your computer and use it in GitHub Desktop.
Save wtnabe/1344386 to your computer and use it in GitHub Desktop.
A option for shut xargs trailed command up when no data from stdin on Linux
#! /bin/sh
XARGS_NO_RUN=''
if [ `uname` = 'Linux' ]; then XARGS_NO_RUN='--no-run-if-empty'; fi
find PATH CONDITIONS | xargs $XARGS_NO_RUN COMMAND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment