Sponsored Content
Top Forums Shell Programming and Scripting Copying files to new dir structure. Post 302645339 by arcanas on Wednesday 23rd of May 2012 08:56:29 AM
Old 05-23-2012
That works! Thanks for the help!

I also came up with this as another option:

Code:
#!/bin/bash
sdir=<path>/dira
ddir=<path>/dirb

cd "$sdir"; 

IFS='\
'
for author in `ls -1`; 
do 
(mkdir "$ddir/$author"; find "$author" -type f -name "*.epub" -exec cp "{}" "$ddir/$author" \;); 
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

copying files to new dir

Hello, I'm new to shell scripting so I don't really understand what I'm doing wrong. The script I'm trying to do saves all the files (*.c) on the current dir to a list and, one by one, copies them to a new one called Backup. The thing is, if there are already other versions of the files I'm... (6 Replies)
Discussion started by: G3nn
6 Replies

2. UNIX for Advanced & Expert Users

copying of files by userB, dir & files owned by userA

I am userB and have a dir /temp1 This dir is owned by me. How do I recursively copy files from another users's dir userA? I need to preserve the original user who created files, original group information, original create date, mod date etc. I tried cp -pr /home/userA/* . ... (2 Replies)
Discussion started by: Hangman2
2 Replies

3. Shell Programming and Scripting

Script to run a command on all txt files present in a dir structure

Hi, I have a directory structure like the one given below root\a\b1 root\a\b2 root\b\b1 root\b\b2 . . . root\j\b1 root\j\b2 Now, there are a txt files in each dir and subdir, there is a root.txt I have to write a script where in i have to run a command called "genrb <filename>"... (6 Replies)
Discussion started by: vikramsinghnegi
6 Replies

4. Shell Programming and Scripting

Copying a directory structure with the latest versions of files

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

Copying specific files from one dir to another

Hi Folks, I have one curious case. There are list of following files placed in one directory such as... And updated each month. files.JAN09.csv files.FEB09.csv files.MAR09.csv ..... Now, I need to move a specific files; i.e, For this month, I need to move only OCT09, NOV09, DEC09,... (1 Reply)
Discussion started by: Jerald Nathan
1 Replies

6. Shell Programming and Scripting

Copy files from input file with dir structure

hi, I want to copy files from source directory based on input file (or output of previous command) and i want to have the SAME DIRECTORY STRUCTURE. Note that i will have other files and directories which i dont want to copy to destination. For example, dir source has following content:... (22 Replies)
Discussion started by: dragon.1431
22 Replies

7. UNIX for Dummies Questions & Answers

copying the dir/subdir structure from one server to another?

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

8. Shell Programming and Scripting

Issue with copying files into dir inside for loop

Hi , I'm trying to move/copy the files inside the loop into a directory . I tried the below code and the issue is the data is not copying into the created directory but the files are copying into another file file_path="/home/etc" Last_Day=20130930 mkdir $file_path/ARC_${Last_Day} ... (3 Replies)
Discussion started by: smile689
3 Replies

9. Shell Programming and Scripting

PERL - Copying ONLY files from one dir to another

I'm writing a Perl script which has its 1st step as to copy files from one directory to another directory. The Source directory has got files with extension, without extension, directories etc. But I want to copy ONLY files with no extension. The files with extensions and directories should not get... (2 Replies)
Discussion started by: jhamaks
2 Replies

10. Shell Programming and Scripting

Copying files from various folders to similar folder structure in another location

Hi, I need to write a script the has to copy the files from folders and subfolders to the same folder structure located in another location. Ex: mainfolder1 file1,file2,file3 subfolder1(file1,etc) subfolder2(file1,etc) to another folder location of same folder structure. rsync is not... (7 Replies)
Discussion started by: Raji Perumal
7 Replies
CPANPLUS::Module::Author(3)				User Contributed Perl Documentation			       CPANPLUS::Module::Author(3)

NAME
CPANPLUS::Module::Author - CPAN author object for CPANPLUS SYNOPSIS
my $author = CPANPLUS::Module::Author->new( author => 'Jack Ashton', cpanid => 'JACKASH', _id => INTERNALS_OBJECT_ID, ); $author->cpanid; $author->author; $author->email; @dists = $author->distributions; @mods = $author->modules; @accessors = CPANPLUS::Module::Author->accessors; DESCRIPTION
"CPANPLUS::Module::Author" creates objects from the information in the source files. These can then be used to query on. These objects should only be created internally. For "fake" objects, there's the "CPANPLUS::Module::Author::Fake" class. ACCESSORS
An objects of this class has the following accessors: author Name of the author. cpanid The CPAN id of the author. email The email address of the author, which defaults to '' if not provided. parent The "CPANPLUS::Internals::Object" that spawned this module object. METHODS
$auth = CPANPLUS::Module::Author->new( author => AUTHOR_NAME, cpanid => CPAN_ID, _id => INTERNALS_ID [, email => AUTHOR_EMAIL] ) This method returns a "CPANPLUS::Module::Author" object, based on the given parameters. Returns false on failure. @mod_objs = $auth->modules() Return a list of module objects this author has released. @dists = $auth->distributions() Returns a list of module objects representing all the distributions this author has released. CLASS METHODS
accessors () Returns a list of all accessor methods to the object perl v5.16.3 2013-05-20 CPANPLUS::Module::Author(3)
All times are GMT -4. The time now is 01:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy