That command has a couple of issues. The file will probably be owned by root, and it will end up in the home directory of whomever is running the sudo command (not necessarily the desired user).
I would suggest something like:
sudo -u shiva cp /usr/local/afni/bin/AFNI.afnirc ~shiva/.afnirc
And maybe apply the user with a variable.
How does that seem?
- rick