I should echo only names of files or directories with this construction:
ls -Al | while read string
do
...
done
ls -Al output :
drwxr-xr-x 12 s162103 studs 12 march 28 12:49 personal domain
drwxr-xr-x 2 s162103 studs 3 march 28 22:32 public_html
drwxr-xr-x 7 s162103 studs 8 march 28 13:59 WebApplication1
For example if I try:
ls -Al | while read string
do
echo "$string" | awk '{print $9}
done
then output only files and directories without spaces. If file or directory have spaces like "personal domain" it will be only word "personal".
I need very simple solution. Maybe there is better solution than awk.