I'm trying to execute a script with sed command, but I'm having problems with the result. I need to change the content in a file in the string "name" with for the result of the command "ls" in a directory, but only need the position 21 to 24 from the name of the file. Is possible there are several files, so I need a loop.
This is my script
for i in `ls file*`
sed -e "s/name/echo `$i|cut -c 21-24`/g" /home/pp/jcl