Hi Guys, trying to write a script which will pass a list txt file through the initial command.
What I'm trying to do is for words listed in the txt file it will then trigger a mv command to move the files from one folder into another.
below is what I currently have as a test base.
when ever I run the script it will create a "file" (not with the txt format) of the first word on the first line in the list in the destination folder and then create the files of the first word from the other lines in the directory the txt file is located in.
Code:
INPUT_FILE="/sripts/list.txt"
CONNECTIONS=`grep "." $INPUT_FILE | cut -f 1`;
for each in "$CONNECTIONS"; do
touch /disk2/test/$each.txt;
done
the list.txt file looks like the following
"file 1"
"file 2"
"file 3"
if i run "touch /disk2/test/"file 1".txt" on the cli it works fine and creates the file with the spaces.
running the "connections" command comes through fine and shows what is expected
any ideas where i'm going wrong?