Shell scripting- processing hidden files

use*_*080 0 bash shell file

I'm working on a project where I have to process the contents of a directory passed in as an argument, and I need to include invisible files (ones that start with .) as well. This is how I'm approaching it

#!/bin/bash

cd $1
for file in `dir -a -d * `;
do
#more code blah blah 
Run Code Online (Sandbox Code Playgroud)

even though I use the -a tag on the dir command, it still ignores invisible files. Any ideas why?

Sie*_*geX 5

Just do:

#!/bin/bash

shopt -s dotglob
cd "$1"
for file in *; do
  # more code blah blah
done
Run Code Online (Sandbox Code Playgroud)

From the bash manpage

When a pattern is used for filename expansion, the character ‘.’ at the start of a filename or immediately following a slash must be matched explicitly, unless the shell option dotglob is set.