I'm quite new to shell scripting . I wanted to mount a NFS share[volume1] and switch to a LDAP user[user001@ldap.com]in the NFS volume and perform some operations via shell script . example
#!/bin/sh
echo "switch to ldap user"
su user001@ldap.com
mount -o nfsvers=3,minorversion=0 <server-ip>:/<nfsvol> <mountpoint>
echo "mount done"
touch abc.txt
I was able to do it in the script till i switch to the user001.But after switching to user001 , script didnt get executed and script control came to user001@ldap.com@shell] and was expecting my input
Only when I give exit , script proceeded . Please let me know how to switch as a new user and continue with the operations. Thanks in advance