I have a copy statement that needs to execute from a shell script. A sample statement is given below.
cp /data/a/le/lecfil.dbd /bkup2/incr/a/le/lecfil.dbd
The problem is the directory /bkup2/incr/a/le doesn't exist though /bkup2/incr exists. I want my cp command to create the directory if necessary and copy the file to destination.
Can some one help?