I'm trying to make a bash script that deals with every file in a directory. All of those file names begin with a dot, so they're hidden. When I try to use a wildcard to grab everything in the directory, the wildcard isn't expanding.
My code that loops over it looks like this right now:
#!/bin/bash shopt -s extglob for i in "$(pwd)"/*; do echo "$i" done
The output is just
/Users/.../*. The wildcard doesn't expand.
This is different than some of the other threads because it deals with hidden files specifically. If I add a file like
test to the directory, then it works. I get
I tried running this in the terminal by itself as well and got the same result. How do I get the wildcard to expand for hidden files?