Put find word count result into a variable

Chirag picture Chirag · Apr 13, 2012 · Viewed 8.5k times · Source
#!/bin/bash
find *.txt | wc -l;

this gives number of txt files. In my program how do I put this output into a variable say "count"

Answer

rid picture rid · Apr 13, 2012
#!/bin/bash
count=$(find *.txt | wc -l)