Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

cp: cannot create regular file

RamarajuAug 22 2018 — edited Aug 22 2018

Hi All,

While executing shell script I am getting following error.

cp: cannot create regular file ‘/search’: Permission denied

I have the permissions on 'search' directory, when I doing it manually, it is creating file successfully.

drwxr-xr-x  7 rep rep  103 Aug 22 16:43 search

Following is the script.

#######################################################################################

# Install ss_test.pkg file

#

if [ -f $PKG_HOME/search/ss_test.pkg ]; then

   cp -rf $PKG_HOME/search/ss_test.pkg $PKG_HOME/search/ss_test.pkg.pre${MIGRATION}.${DATE}

fi

cp -rf ss_test.pkg $PKG_HOME/search

status=$?

if [ $status -eq 1 ]; then

echo "ss_test.pkg Execution Failed"

   exit 1

else

   echo "ss_test.pkg File executed Successfully"

fi

exit

######################################################################################

Thanks,

Ramaraju

This post has been answered by Ramaraju on Aug 22 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2018
Added on Aug 22 2018
6 comments
4,963 views