I want to create a script that will include the ability to convert a Windows unc path to something usable for the Mac. I'm only working on the conversation portion right now and have put the following together by finding some examples online.
echo '\\server.domain.eduhome$mmouse' | sed -e 's/\\///g'
This works for the moment but then I'd like to also add on the "smb:" portion. I thought I could use command substitution for this to keep it all on one line but I'm running into an error.
echo smb:`echo '\\server.domain.eduhome$mmouse' | sed -e 's/\\///g'`
sed: 1: "s////g
": unescaped newline inside substitute pattern
smb:
If I try the following, it somewhat works but drops a "/".
echo smb:`echo '\\server.domain.eduhome$mmouse'` | sed -e 's/\\///g'
smb:/server.domain.edu/home$/mmouse
In a script I figure I could always do the conversion and add the "smb:" on a separate line but I'm curious how to make it happen in one line. Can anyone explain what I'm doing wrong assuming this is possible?