-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2216
koalaman edited this page Jul 3, 2017
·
4 revisions
ls | echo # Want to print result
cat files | rm # Want to delete items from a file
find . -type f | xargs cp dir # Want to process 'find' output
ls
cat files | while IFS= read -r file; do rm -- "$file"; done
find . -type f -exec cp {} dir \;
You are piping to one of several commands that don't read from stdin.
This may happen when:
- Confusing one command for another, e.g. using
echo
wherecat
was intended. - Incorrectly refactoring, leaving a
|
on the previous line. - Missing
xargs
, because stdin should be passed as positional parameters instead (usexargs -0
if at all possible).
Check your logic, and rewrite the command so data is passed correctly.
If you've overridden a command to return output, you can either rename it to make this obvious, or ignore this message.