|
copy files from one dir to another
Hi ,
I want to copy files from one dir to anothe dir and check if destination dir exists ,if not exist ,has to create but when executing the below schell script ,the destination directory not exist and exit the shell script.
#!/bin/sh
src_path=/home/owngdw/abc
tgt_path=/home/owngdw/abc/xyz
if [ ! -d ${tgt_path}];
then
mkdir -p ${tgt_path}
#mkdir -p abc/xyz
fi
cp ${src_path}/aaa* ${tgt_path}/
Thanks
MR
|