You need to use the correct quotation or the shell will try to expand *.txt
before it find
sees it.
, a.txt
b.txt
, find /var/log -name a.txt b.txt
→ find
, b.txt
. script :
path="$1"
searchstring="$2"
echo $(find "$path" -name "$searchString")
for filename in $(find "$path" -name "$searchString")
do
echo "$filename"
echo
done
, ( glob , searchstring
. , .
$()
! , "" .
$()
inline-eval back-ticks. , .