I want to loop over the files that begin with '.' in directory x (x might be any path):
$ for file in x/.*
> do
> echo -n $file" "
> done
x/. x/.. x/..a x/.b
What is the best way to get rid of x/., and x/.. ?
with bash, you can use GLOBIGNORE
$ ls -1tra
..
.test1
.test
test
.
$ for i in .*; do echo $i;done
.
..
.test
.test1
$ GLOBIGNORE=".:.."
$ for i in .*; do echo $i;done
.test
.test1