Skip to content

Instantly share code, notes, and snippets.

@smly
Last active October 10, 2015 06:48
Show Gist options
  • Select an option

  • Save smly/3650402 to your computer and use it in GitHub Desktop.

Select an option

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
#!/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