銈裤兗銉熴儕銉仹Windows銈凪ac銇儠銈°偆銉偟銉笺儛銉笺伄銉戙偣銇哥浉浜掔疆鎻涙柟娉

Windows銈凪ac銇儜銈广倰缃彌銇椼仧銇

銉曘偂銈ゃ儷銈点兗銉愩兗銇儜銈广伅Windows銇∕ac銇с伅褰㈠紡銇岀暟銇倠銇熴倎銆乄indows銇儜銈广仹Mac銇儠銈°偆銉偟銉笺儛銉笺伀銈€偗銈汇偣銇欍倠銇撱仺銇仹銇嶃仾銇勩

涓嬭銇氥倞Window銇犮仺銉愩儍銈偣銉┿儍銈枫儱銇仾銇c仸銇娿倞銆丮ac銇犮仺鍐掗牠銇宻mb:銇с伅銇樸伨銈嬨偣銉┿儍銈枫儱銇с亗銈嬨

\\FS\CA\file\
smb://FS/CA/file/

銇濄伄銇熴倎Windows銇儜銈广仹銈傘儛銉冦偗銈广儵銉冦偡銉ャ倰銈广儵銉冦偡銉ャ伀缃彌銇椼仸鍐掗牠銇玸mb:銈掍粯銇戙倢銇癕ac銇с倐浣跨敤銇с亶銈嬨

銇熴仩銇椼佹墜浣滄キ銇т竴銇ゃ仛銇ょ洿銇欍伄銇亱銇倞闈㈠掋仹銇傘倠銆

銈裤兗銉熴儕銉仹銉戙偣銈掔疆鎻涖仚銈嬫柟娉

鎵嬩綔妤仹鐩淬仚銇伅銇嬨仾銈婇潰鍊掋仩銇屻偪銉笺儫銉娿儷銇с儜銈广倰缃彌銇椼仸銈儶銉冦儣銉溿兗銉夈伀淇濆瓨銇欍倢銇扮啊鍗樸伀缃彌銇椼仧銉戙偣銈掑埄鐢ㄣ仹銇嶃倠銆

銈勩倞鏂广伅銇俱仛 $ vi ~/.bashrc 銇.bashrc銉曘偂銈ゃ儷銈掗枊銇勩仸涓嬭銇儜銈广倰淇濆瓨銇欍倠銆

alias cw='read -rp "Windows銇儜銈广倰鍏ュ姏銇椼仸Mac銇鎻: " p && echo $p | sed 's#\\\\\\\\#/#g' | sed 's#//#smb://#g' | pbcopy && pbpaste'
alias cm='read -rp "Mac銇儜銈广倰鍏ュ姏銇椼仸Windows銇鎻: " p && echo $p | sed 's#\/#\\\\\\\\#g' | sed 's#smb:##g' | pbcopy && pbpaste'

淇濆瓨銇椼仧銈 $ source ~/.bashrc 銇ц銇胯炯銈併伆銈裤兗銉熴儕銉仹cw銇ㄥ叆鍔涖仚銈嬨仺"Windows銇儜銈广倰鍏ュ姏銇椼仸Mac銇鎻: "銇ㄨ〃绀恒仌銈屻倠銇仹銆孿\FS\CA\file\銆嶃伄銈堛亞銇儜銈广倰鍏ュ姏銇椼仸enter銈掓娂銇涖伆銆宻mb://FS/CA/file/銆嶃仺缃彌銇曘倢銇︺偗銉儍銉椼儨銉笺儔銇繚瀛樸仌銈屻倠銆
銈裤兗銉熴儕銉仹Windows銈凪ac銇儠銈°偆銉偟銉笺儛銉笺伄銉戙偣銇哥浉浜掔疆鎻涙柟娉

閫嗐伅cm銈掑叆鍔涖仐銇"Mac銇儜銈广倰鍏ュ姏銇椼仸Windows銇鎻: "銈掍娇鐢ㄣ仚銈嬨

Automator銇у彸銈儶銉冦偗銇嬨倝缃彌

Automator銈掍娇鐢ㄣ仚銈屻伆銉嗐偔銈广儓銈掗伕鎶炪仐銇﹀彸銈儶銉冦偗銇嬨倝缃彌銇椼仸銈儶銉冦儣銉溿兗銉夈伀淇濆瓨锛嗐儦銉笺偣銉堛亴銇с亶銈嬨

銇熴仩銇椼併亾銈屻亴銇с亶銈嬨伄銇疭afari銈凙pple绱旀銇儭銉€仾銇┿伄銈€儣銉偙銉笺偡銉с兂銇檺銈夈倢銈嬨

銈勩倞鏂广伅Automator銇柊瑕忎綔鎴愩仹銈偆銉冦偗銈€偗銈枫儳銉炽倰閬告姙銇椼仸銈儶銉冦儣銉溿兗銉夈伀銈炽償銉硷紜銈枫偋銉偣銈儶銉椼儓銈掑疅琛屻倰绲勩伩鍚堛倧銇涖倠銇犮亼銇犮(銈炽兗銉夈伅涓嬭銇倛銇嗐伀銇倠)

sed 's#\\#/#g' | sed 's#^//#smb://#g' | pbcopy && pbpaste

Automator銇柊瑕忎綔鎴愩仹銈偆銉冦偗銈€偗銈枫儳銉炽倰閬告姙銇椼仸銈儶銉冦儣銉溿兗銉夈伀銈炽償銉硷紜銈枫偋銉偣銈儶銉椼儓銈掑疅琛屻倰绲勩伩鍚堛倧銇涖倠