I'm trying to run a command on every entry in a line of text:
#! /bin/bash
range=$(ls -s /home/user/Pictures/Wallpapers | wc -l)
for (( i=0; i<$range; i++ ))
do
d=$(ls /home/user/Pictures/Wallpapers | paste -sd " " | awk -F' ' '{ print $i }')
echo $d
done
But when I run it, it simply prints out the entire line of file entries with every iteration of the loop. I think it's because the "i" is not being interpreted since it's technically in between single quotes, and I can't figure out how to prevent it from doing this.
Thanks.
pasteandawk?