Need to process files in current directory one at a time. I am looking for a way to take the output of ls
or find
and store the resulting value as
for i in `ls`; do echo $i; done;
can't get simpler than that!
edit: hmm - as per Dennis Williamson's comment, it seems you can!
edit 2: although the OP specifically asks how to parse the output of ls
, I just wanted to point out that, as the commentators below have said, the correct answer is "you don't". Use for i in *
or similar instead.