I need to print the number of characters of every file name in a directory using a for loop in the terminal (Mac). This directory is called lorem and it has 3 files: at.txt, lorem.txt and sed.txt.
Up to now I have done this:
lorem sarahr$ ls
at.txt lorem.txt sed.txt
FILES=/Users/sarahr/lab-bash-master/lorem/*
lorem sarahr$ for i in $FILES
> do
> echo '$FILES has' | wc -c
> done
11
11
11
Eleven three times is the result, but it's not what I need. Could you help me?