The same way you do any string that contains characters that need to be escaped:
mount_smbfs //username:my`[email protected]/folder/
or
mount_smbfs '//username:my`[email protected]/folder/'
You can't use double quotes alone, because the backtick in a double-quoted string is interpreted as the start of a command substitution. You could write
mount_smbfs "//username:my`[email protected]/folder/"
Based on the error message, the problem isn't protecting the backtick from the shell, but from the URL parsing library. Try
mount_smbfs '//username:%60123%[email protected]/folder/' mountpoint
where %60
is the URL-quoted form for a backtick. Quoting the URL anyway is good practice: don't expose anything you don't want processed to the shell, even if you are sure there's nothing that the shell would process.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…