Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 11th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2. # From Chris Picton
  3. # Replaces a Script by Martin Enlund
  4. # Modified to work with spaces in path by Christophe Combelles
  5.  
  6. # This script either opens in the current directory,
  7. # or in the selected directory
  8.  
  9. base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
  10. if [ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
  11.      dir="$base"
  12. else
  13.      while [ ! -z "$1" -a ! -d "$base/$1" ]; do shift; done
  14.      dir="$base/$1"
  15. fi
  16.  
  17. gnome-terminal --working-directory="$dir"