I'm trying to write a bash script that basically stores a file list into an array, loops through the array and then appends something to the files. I.e. loop through a directory and add a . to the beginning to make it hidden.
I know this is fairly simple but I've never really worked with arrays or loops in bash at all.
1. Insert file list into array
2. Loop through array
3. cat something to the file name (would I have to use rn? or is there a way to add something to the filename?)
#!/bin/bash
#get files on desktop and store into array
cd /Users/$3/Desktop/
files=($(ls))
#loop through array and cat something to beginning
for file in files; do
done