I have two users and groups in Unix: user1:user1 and user2:user2.I have a directory myDirectory with below details (ls -ltr)drwxr-xr-x.  4 user2 user2   35 Apr 27 10:16 myDirectoryNow, I am running a script, myScript.sh as user1:#!/bin/shwhoamiif [ -f /myDirectory/*.tar.gz ]then    rm -f /myDirectory/*.tar.gzficp -f someDirectory/*.tar.gz /myDirectory/However, I get the following error:cp: cannot create regular file /myDirectory/myTar.tar.gz: Permission deniedWhat am I doing wrong?How can I fix this?
Shell script by one user to copy a file into directory owned by different user
shell script;not root user