Here at work we have a couple of samba shares and a few people that work most of their time in windows. I've found the following simple script (I've called it pwd_windows) useful:
Code:
#!/bin/bash
projects_name=/mnt/server/projects
quotes_name=/mnt/server/quotes
current_dir=$(pwd)
server_name=${current_dir/$projects_name/Z:}
server_name=${server_name/$quotes_name/Y:}
echo ${server_name//\//\\}
typing pwd_windows in a directory gives it's windows name:
Code:
pabloa$ pwd
/mnt/server/quotes/Batch 2 - June 24 2011
pabloa$ pwd_windows
Y:\Batch 2 - June 24 2011
Ready to be copy-pasted into an email!
Cheers.
P.