12-03-2010
Help with copying specific parts of a file structure
Hello. I need help with copying part of a file structure to another directory while still keeping the structure. For example look below:
../folder1/sub1/txt.txt
../folder1/sub2/pic.png
../folder2/sub1/pic.png
../folder2/sub2/txt.txt
So in this I would like to copy only the directories and sub-directories that contains a file with a png extension.
Cheers, the.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all
Is it possible to copy a structure of a directory only.
e.g.
I have a file with the following entries that is a result of a find :-
/dir1/dir2/file.dbf
/dir1/dir2/dir3/file1.dbf
/dir1/file.dbf
I want to copy these to a directory and keep the structure however starting at a new dir... (8 Replies)
Discussion started by: jhansrod
8 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I need to copy a set of directories along with all sub directories and files from one unix box to another. Any ideas?
cnfsed (4 Replies)
Discussion started by: Cnfsed
4 Replies
3. Shell Programming and Scripting
Dear Experts,
How can I solve this problem ?
I want to redirect with having the same directory structure as in my input.
for temp in `find ./CSV/ -name "*.v"`
do
fname = `basename $temp`
./script.sh $temp > ./out/$fname
done
But my problem here is all the... (3 Replies)
Discussion started by: user_prady
3 Replies
4. Shell Programming and Scripting
Hello
I have three directory structures for code releases.
Each directory structure looks like this:
bash-3.00$ ls -R | more
.:
Test_Release_1
Test_Release_2
Test_Release_3
./Test_Release_1/dbcode:
rp_online_import_srdp.pkb-1
srdp_ar_validation.pkb-1... (1 Reply)
Discussion started by: Glyn_Mo
1 Replies
5. Shell Programming and Scripting
How can i break a text file into parts that occur between a specific pattern?
I have text file having various xml many tags like which starts with the tag "<?xml version="1.0" encoding="utf-8"?>" . I have to break the whole file into several xmls by looking for the above pattern.
All the... (9 Replies)
Discussion started by: abhinav192
9 Replies
6. Shell Programming and Scripting
How do you truncate specific parts of a string.
Example:
1 This is the string
Goal:
This is the string
As you can see I'm trying to simply remove the first two characters of the string the number one and the space between the one and the word "this."
Your help is appreciated.
... (8 Replies)
Discussion started by: royarellano
8 Replies
7. Shell Programming and Scripting
I am trying to figure out a way to script copying specific files from one dir structure to another.
I have a dir structure like this:
dira/author 1/book 1/file a.epub
/book 2/file b.epub
/author 2/book 1/file c.epub
/author 3/book 1/file d.epub
/book 2/file... (2 Replies)
Discussion started by: arcanas
2 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I want to copy the dir/subdir structure from SERVER-A to SERVER-B without copying all the files in each dir.
Is it possible using SCP / SFTP command?
For example,
SERVER-A has following two dir/subdirectories and files under each subdir.
... (1 Reply)
Discussion started by: Hangman2
1 Replies
9. Shell Programming and Scripting
Hi all,
I desperately need a small script which deletes everything in a particular .txt file when "Abs = {" appears till "},", and also when "B-1 = {" appears till "},"
I would like all the text in between of those instances to be deleted, however, other text to be unedited (kept as it is).... (12 Replies)
Discussion started by: c_lady
12 Replies
10. Shell Programming and Scripting
I am trying to write a script that cycles through a folder containing many folders and when inside each one it's supposed to copy all the .fna.gz files to a folder elsewhere if the file and the respective folder have the same name.
for fldr in /home/playground/genomes/* ; do
find .... (8 Replies)
Discussion started by: Mr_Keystrokes
8 Replies
LEARN ABOUT DEBIAN
tp-magic-config
TP-MAGIC-CONFIG(1) tp-magic-config TP-MAGIC-CONFIG(1)
NAME
tp-magic-config -- Helps creating 'Magic' tool plugins for Tux Paint(1)
SYNOPSYS
tp-magic-config [--apiversion | --version | --cflags | --pluginprefix | --plugindocprefix | --dataprefix | --localpluginprefix | --local-
dataprefix]
DESCRIPTION
tp-magic-config is a simple shell script that responds with various pieces of information about the currently-installed version of Tux
Paint(1) that are useful when building 'Magic' tool plugins.
OPTIONS
--apiversion
Outputs the version of the Tux Paint 'Magic' tool plugin API that the installed copy of Tux Paint supports. (For API compatibility
testing.)
--version
Outputs the version of Tux Paint that tp-magic-config corresponds to.
--cflags
Outputs the compiler flags that Tux Paint 'Magic' tool plugins should be compiled with. (For example, a "-I" include path option
that tells the compiler where it can find the plugin API header file, "tp_magic_config.h", that plugins must #include.)
--pluginprefix
Outputs the system directory where the installed copy of Tux Paint expects to find 'Magic' tool plugins (".so" shared objects).
(e.g., "/usr/share/tuxpaint/plugins")
--localpluginprefix
Outputs the user directory where the installed copy of Tux Paint expects to find 'Magic' tool plugins (".so" shared objects).
(e.g., "/home/username/.tuxpaint/plugins")
--plugindocprefix
Outputs the directory where the installed copy of Tux Paint expects to find documentation for 'Magic' tool plugins (".html" and
".txt" files). Tux Paint's main documentation includes a link to this directory under the section on "Magic" tools.
--dataprefix
Outputs the system directory where the installed copy of Tux Paint keeps its global data files (e.g., "/usr/share/tuxpaint/"). This
is the same value that plugins installed system-wide will receive in the "data_directory" string within the "magic_api" structure
sent to the plugins' functions.
--localdataprefix
Outputs the user directory where the installed copy of Tux Paint expects plugins to install their local data files. (e.g.,
"/home/username/.tuxpaint/plugins/data"). This is the same value that plugins installed locally will receive in the "data_direc-
tory" string within the "magic_api" structure sent to the plugins' functions.
SYSTEM-WIDE SHELL EXAMPLES
$ gcc -shared `tp-magic-config --cflags` my_plugin.c -o my_plugin.so
# cp my_plugin.so `tp-magic-config --pluginprefix`
# cp my_plugin_icon.png `tp-magic-config --dataprefix`/images/magic
# cp my_plugin.html `tp-magic-config --plugindocrefix`/html
# cp my_plugin.txt `tp-magic-config --plugindocrefix`
LOCAL SHELL EXAMPLES
$ gcc -shared `tp-magic-config --cflags` my_plugin.c -o my_plugin.so
$ mkdir -p `tp-magic-config --localpluginprefix`
$ cp my_plugin.so `tp-magic-config --localpluginprefix`
$ mkdir -p `tp-magic-config --localdataprefix`/images/magic
$ cp my_plugin_icon.png `tp-magic-config --localdataprefix`/images/magic
SYSTEM-WIDE MAKEFILE EXAMPLE
MAGIC_CFLAGS=$(shell tp-magic-config --cflags)
MAGIC_PREFIX=$(shell tp-magic-config --pluginprefix)
MAGIC_DOC_PREFIX=$(shell tp-magic-config --plugindocprefix)
DATA_PREFIX=$(shell tp-magic-config --dataprefix)
all: my_plugin.so
my_plugin.so: my_plugin.c
install: install-so install-data install-docs
install-so:
mkdir -p $(MAGIC_PREFIX)
cp my_plugin.so $(MAGIC_PREFIX)/
chmod 644 $(MAGIC_PREFIX)/my_plugin.so
install-data:
mkdir -p $(DATA_PREFIX)
cp icons/my_plugin_icon.png $(DATA_PREFIX)/images/magic/
chmod 644 $(DATA_PREFIX)/images/magic/my_plugin_icon.png
install-docs:
mkdir -p $(MAGIC_DOC_PREFIX)
cp docs/my_plugin.html $(MAGIC_DOC_PREFIX)/html/
chmod 644 $(MAGIC_DOC_PREFIX)/html/my_plugin.html
cp docs/my_plugin.txt $(MAGIC_DOC_PREFIX)/
chmod 644 $(MAGIC_DOC_PREFIX)/my_plugin.txt
AUTHOR
Bill Kendrick. <bill@newbreedsoftware.com>
SEE ALSO
tuxpaint(1),
And documentation within /usr/[local/]share/doc/tuxpaint/.
2007.08.07 07 August 2007 TP-MAGIC-CONFIG(1)