Hi I want to know how to handle the spaces in the below scenario.
I have a file (CON_zip_path_1.txt) which has some directory paths with spaces in directory names . My requirement is to unzip these zip files to
another path. Please see the code below and the error.
CON_zip_path_1.txt file contents -there are 9 directory path records with spaces in folder names:
/Contract Workspaces/Contract Repository/TCW1000 to TCW9999/TCW1000 to TCW1999/TCW1000 to TCW1099/TCW1000 to TCW1009/CW2218812.zip
/Contract Workspaces/Contract Repository/TCW1000 to TCW9999/TCW1000 to TCW1999/TCW1000 to TCW1099/TCW1000 to TCW1009/CW2218800.zip
/Contract Workspaces/Contract Repository/TCW1000 to TCW9999/TCW1000 to TCW1999/TCW1000 to TCW1099/TCW1000 to TCW1009/CW2218600.zip
/Contract Workspaces/Contract Repository/TCW1000 to TCW9999/TCW1000 to TCW1999/TCW1000 to TCW1099/TCW1000 to TCW1009/CW2218563.zip
/Contract Workspaces/Contract Repository/TCW1000 to TCW9999/TCW1000 to TCW1999/TCW1000 to TCW1099/TCW1000 to TCW1009/CW2218553.zip
/Contract Workspaces/Contract Repository/TCW1000 to TCW9999/TCW1000 to TCW1999/TCW1000 to TCW1099/TCW1000 to TCW1009/CW2218556.zip
/Contract Workspaces/Contract Repository/TCW1000 to TCW9999/TCW1000 to TCW1999/TCW1000 to TCW1099/TCW1000 to TCW1009/CW2218559.zip
/Contract Workspaces/2017/May/CW221xxxx/CW22184xx/CW2218471.zip
/Contract Workspaces/2017/May/CRW221xxxx/CRW22184xx/CRW2218451.zip
src_path=/informatica/apps/logs/fin/ote/SrcFiles/Source/Contracts20170706092332/Contracts20170706092332 ;
while read line; do
echo $src_path$line
unzip $src_path$line -d $src_path/Contract\ Workspaces
done < $src_path/CON_zip_path_1.txt ;
error output :
/informatica/apps/logs/fin/ote/SrcFiles/Source/Contracts20170706092332/Contracts20170706092332/Contract Workspaces/Contract Repository/TCW1000 to TCW9999/TCW1000 to TCW1999/TCW1000 to TCW1099/TCW1000 to TCW1009/CW2218812.zip
unzip: cannot find or open /informatica/apps/logs/fin/ote/SrcFiles/Source/Contracts20170706092332/Contracts20170706092332/Contract, /informatica/apps/logs/fin/ote/SrcFiles/Source/Contracts20170706092332/Contracts20170706092332/Contract.zip or /informatica/apps/logs/fin/ote/SrcFiles/Source/Contracts20170706092332/Contracts20170706092332/Contract.ZI
P.