Guest User

Untitled

a guest
Aug 11th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  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"
Advertisement
Add Comment
Please, Sign In to add comment