Blame p_findutils/20-xargs_tests

Athmane Madjoudj 9fdaba
#!/bin/bash
Athmane Madjoudj 9fdaba
echo "Running $0"
Athmane Madjoudj 9fdaba
TMPDIR=/var/tmp/find
Athmane Madjoudj 9fdaba
# Basic xargs tests
Athmane Madjoudj 9fdaba
Athmane Madjoudj 9fdaba
echo "Basic xargs tests"
Athmane Madjoudj 9fdaba
find "$TMPDIR" -type f -print0  | xargs  -0 ls &>/dev/null 
Athmane Madjoudj 9fdaba
#ls  -l >/dev/null
Athmane Madjoudj 9fdaba
t_CheckExitStatus $?
Athmane Madjoudj 9fdaba
Athmane Madjoudj 9fdaba
echo "Check xargs fails when filenames with spaces are passed in"
Athmane Madjoudj 9fdaba
find "$TMPDIR" -type f | xargs ls &>/dev/null  && { t_Log "FAIL: This test returned 0 status incorrectly"; exit $FAIL; }
Athmane Madjoudj 9fdaba
t_Log "PASS"
Athmane Madjoudj 9fdaba
Athmane Madjoudj 9fdaba
Athmane Madjoudj 9fdaba
# Cleanup
Athmane Madjoudj 9fdaba
[[ -d "$TMPDIR" ]] && rm -rf "$TMPDIR"