I am trying to save the result from find
as arrays.
Here is my code:
#!/bin/bash
echo \"input : \"
read input
echo \"searching file with this
For me, this worked fine on cygwin:
declare -a names=$(echo "("; find -printf '"%p" '; echo ")")
for nm in "${names[@]}"
do
echo "$nm"
done
This works with spaces, but not with double quotes (") in the directory names (which aren't allowed in a Windows environment anyway).
Beware the space in the -printf option.