The following bash scripts will not do what (I thought) they are supposed to do:
Oddly enough, it prints
I have no idea what's up with that. Some GLOB thing? Now, if I change it to
Is where my thread title comes in. The latter script only enters the first directory (the username directory) and will not proceed into the $HOME directory proper and recurse as I thought it would.
Any ideas why? Every thing I Googled said that this should work.
Also, I noticed when listing the $HOME directory with
there are two directories with the following names:
and
Is this in any way related?
Code:
#!/bin/bash
for item in ~/*; do
echo $item
done
Code:
/root/*
Code:
#!/bin/bash
for item in /home/*; do
echo $item
done
Any ideas why? Every thing I Googled said that this should work.
Also, I noticed when listing the $HOME directory with
Code:
ls -a ~
Code:
.
Code:
..