What I am trying to do is to count all the files in a directory using shell script.
For example, when execute the program,
./test.sh project
it should count all the files in the folder called "project".
But I am having trouble with the directory part.
What I have done so far is,
#!/bin/bash
directory=$1
count=ls $directory | wc -l
echo "$folder has $count files"
but it does not work... Can anyone blow up my confusion please?
Thanks!
$()(or backticks) do.