Hi,
I am trying to read files from NFS mount. The ID with which I am trying to read is part of 16+ groups.
This is causing problem in doing change directory to the NFS mount directory.
I was able to get some code which does newgrp to change the default group so that I could change directories into NFS mount.
But as per the man pages of "newgrp". Looks like newgrp command invokes new shell everytime when it is called.
I am calling newgrp command as part of my korn shell. I would like to know, if calling it will impact my rest of the shell.
Looks like I could handle this issue by using here document.
But not sure if this is the right way. I have read other documentation to handle this NFS mount 16+ group situation but nothing seems to be helpful in my case (and not easy to understand documentation)
Help is appreciated.
/usr/bin/newgrp group1 << newgrp1
echo "Changing directory to /nfsmount/abc"
cd /nfs/abc
/usr/bin/newgrp group2
cd /nfs/abc/def
cp /nfs/abc/def/test.txt /landingarea/app
if [ $? -eq 0 ];
then
echo "copy successfull"
else
echo "copy failed
fi
newgrp1