#!/bin/bash #Company: PowerCraft Technology #Author: Copyright Jelle de Jong #Note: Please send me an email if you enhanced this script #Version: 0.0.1 #Date: 13-06-07 #System: Ubuntu/Debian GNU/Linux #Information: http://wooledge.org/mywiki/BashFaq#faq50 #Category Thunar scripts (thunar->edit->custom actions) #Name: Create Tree #Description: Create a duplicate directory tree #Command: xfce4-terminal --disable-server --hide-toolbars --execute /usr/share/pct-thunar-scripts/scripts/directory-create-tree %F #Patterns: * #Directories: True # Did the script work for you? # Yes # Yes, but with some errors # Yes, but I had to change some things # Not at all # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. TEXTDOMAINDIR=/usr/share/locale TEXTDOMAIN=${0##*/} NAME=$"Create Tree" DESCRIPTION=$"Create a duplicate directory tree" echo $"program:" echo "$0" echo $"description:" echo "$DESCRIPTION" for I in "$@" do dirname=${I%/*} file=${I##*/} filename=${I##*/}; filename=${filename%.*} extension=${I##*.} echo "$dirname" echo "$file" echo "$filename" echo "$extension" destination="$dirname/$filename-tree-duplicate" cd "$I" find . -type d -print | cpio -pdumv "$destination" done exit 0