I want to iterate over each line in the output of: ls -l /some/dir/*
ls -l /some/dir/*
Right now I\'m trying: for x in $(ls -l $1); do echo $x; done
for x in $(ls -l $1); do echo $x; done
As already mentioned, awk is the right tool for this. If you don't want to use awk, instead of parsing output of "ls -l" line by line, you could iterate over all files and do an "ls -l" for each individual file like this:
for x in * ; do echo `ls -ld $x` ; done