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
ls
find
You actually don't need to use ls/find for files in current directory.
Just use a for loop:
for files in *; do if [ -f "$files" ]; then # do something fi done
And if you want to process hidden files too, you can set the relative option:
shopt -s dotglob
This last command works in bash only.