I want to find out the number of directories and files in home directory and store that in a shell variable. I am using the following set of commands.
command="ls -l | grep -c \"rahul.*patle\""
eval $command
I want to store the result in a variable. How can I do this?