I'm trying to make a script that counts files/directories in a specific directory but I have a problem. Here's the script that works for a current directory (count.sh):ARG3=${1:-d} #default value - count directories ls -l| grep ^$ARG3 | wc -lI'd love to make a script that works for any directory, not only current one but I have no idea how I could make it. I've searched in google for a long time, unfortunately without success.The script should be called like:./count.sh  what_to_count(files or dirs)  selected_dir_to_count_in_itDo you have any ideas how to do it?
Count amount of files/directories in SELECTED directory
bash;shell script;shell;scripting;zsh