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
It depends what you want to do with each line. awk is a useful utility for this type of processing. Example:
ls -l | awk '{print $9, $5}'
.. on my system prints the name and size of each item in the directory.