The correct way to do this is with xargs:
$find ./test_dir -print | xargs rm -rf
Edited Thanks to SiegeX to explain the OP question to me.
This is "reading" the wrong files from the test directory and removing it from the target directory.
$unzip foo.zip -d /path_to/test_dir $cd target_dir (cd /path_to/test_dir ; find ./ -type f -print0 ) | xargs -0 rm
I use find -0 because file names can contain spaces and newlines. But if that is not the case, you can start using ls :
$unzip foo.zip -d /path_to/test_dir $cd target_dir (cd /path_to/test_dir ; ls ) | xargs rm -rf
before execution you should check the script change rm to echo
source share