Cp command in execute command stage
Posted: Mon Mar 28, 2011 6:10 pm
Hi,
Iam trying to copy latest file in a directory to the other using the below command .My DirPath1 may also contain subdirectory, so i used grep .
cp `ls -ltr #$DirPath1 | grep ^- | tail -1 | awk '{print $9}'` #$dirPath2#/.
This command works fine in putty but donot in datstage.
In the log i could see the below error message
Output from command ====>
cp: omitting directory `DirPath1'
cp: cannot stat `xyz.CSV': No such file or directory.
So ,can anyone help me out how to use this in execute comman stage.
Iam trying to copy latest file in a directory to the other using the below command .My DirPath1 may also contain subdirectory, so i used grep .
cp `ls -ltr #$DirPath1 | grep ^- | tail -1 | awk '{print $9}'` #$dirPath2#/.
This command works fine in putty but donot in datstage.
In the log i could see the below error message
Output from command ====>
cp: omitting directory `DirPath1'
cp: cannot stat `xyz.CSV': No such file or directory.
So ,can anyone help me out how to use this in execute comman stage.