Help converting Apple Script to Shell Script This Apple Script works great to mount the logged in Active Directory users network homedrive as a mounted network drive but we currently have it running as an App at login via "Login Items". 

Instead I'd like to write this as a shell script so I can push it via Profile Manager as a login script since we are now succesfully running a few tasks off of a login script from PM.

Here is the AppleScript:

set username to do shell script "whoami"

set homepath to do shell script "dscl '/Active Directory/CAMPUS/All Domains/' -read /Users/" &amp; username &amp; " | grep SMBHome: | cut -c 10- | sed 's/\\\\/\\//g' "

tell application "Finder"

    try
        mount volume "SMB:" &amp; homepath
    end try
end tell


Thank you for your help!
Below is a starting point.

username=`whoami`
homepath=`dscl '/Active Directory/CAMPUS/All Domains/' -read /Users/$username |grep SMBHome: | cut -c 10- | sed 's/\\\\/\\//g'`

mount_smbfs $homepath &lt;mount_point&gt;


I'm not really sure of the mount syntax.  This answer may help with mount syntax.