lolaferrari
asked on
Pattern matching error
I have a directory with a list of machine names and some with domain names and some without. I want to check a file in each <machine>/sub dir. My hostlist only has the machine name without a FQDN
For i in cat hostlist; do cat $i*/file;fi; done ( it will not see the file with this wildcard - not sure how to cat tried cat ^$i but still didn't work.
The directory looks like this:
Machine1/file
Machine.my.domain.com/file
Machine.specialdomain.net/ file
Machine2/file
For i in cat hostlist; do cat $i*/file;fi; done ( it will not see the file with this wildcard - not sure how to cat tried cat ^$i but still didn't work.
The directory looks like this:
Machine1/file
Machine.my.domain.com/file
Machine.specialdomain.net/
Machine2/file
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If your original code looked like
then that would work just fine.
for i in $(cat hostlist)
do
cat $i*/file
done
then that would work just fine.
ASKER