Last active
October 10, 2015 06:48
-
-
Save smly/3650402 to your computer and use it in GitHub Desktop.
open file at samba shares (Windows file-sharing) using the file path in windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| ## Open file at samba shares (Windows file-sharing) using the file path in windows | |
| ## (for OSX only) | |
| usage() | |
| { | |
| >&2 <<-\HELP | |
| Usage: opensmb '\\fileserver\public\all_your_base_are_belong_to_us.mp3' | |
| HELP | |
| } | |
| BACKSLASH='\' | |
| SLASH='/' | |
| INPUT_PATH=${*#$BACKSLASH$BACKSLASH} | |
| OPEN_PATH='smb:/'${INPUT_PATH//$BACKSLASH/$SLASH} | |
| open $OPEN_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment