I\'m learning bash scripting and have written a script to count the files and directories in the directory that is supplied as argument. I have it working one way which seem
You're not iterating over the list of files inside the given directory; add /* after $LOCATION. Your script should look like:
...
for item in $LOCATION/*
do
...
As pointed by dogbane, just adding /* will count only files that does not begin with .; for doing so, you shall do the following:
...
for item in $LOCATION/* $LOCATION/.*
do
...