I have a CT.txt with below input data.
CT.txt:
test testing test 1
And with below script:
#!/bin/bash
for CITY in $(cat /home/user/CT.txt)
do
FILES=/mnt/dir1/dir2/$CITY/*
echo $FILES
Giving me output as follow:
/mnt/dir1/dir2/test
/mnt/dir1/dir2/testing
/mnt/dir1/dir2/test/*
/mnt/dir1/dir2/1/*
where output should be:
/mnt/dir1/dir2/test
/mnt/dir1/dir2/testing
/mnt/dir1/dir2/test 1
How to make CT.txt file to read having space in between test 1.
CT.txtcontent is linear you cannot even achieve it by quoting. Is yourCT.txtcontent are in one line only? – αғsнιη Aug 03 '17 at 08:22