03-26-2009
Copying files multiple times increasing sequentially
I am looking for the easiest way to copy a set of files 1000 times and increment sequentially.
I want to copy these 2 files:
Scenario.1.1.ud
Scenario.1.2.ud
So that it creates the following:
Scenario.2.1.ud
Scenario.2.2.ud
Scenario.3.1.ud
Scenario.3.2.ud
..
..
Scenario.1000.1.ud
Scenario.1000.2.ud
Any suggestions? Thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Friends,
My goal is to copy 1000 of files of same filesize simultaneously to a directory. i.e i do multiple copies into a same directory. What i feel here is, at some 1000th iteration, few transfers ends in advance before some transfers start. I need to get synchronized file transfers so that... (1 Reply)
Discussion started by: amio
1 Replies
2. UNIX for Dummies Questions & Answers
We want to copy the data from all the files SPR_201103* to AMGEN.
We tried the following command
cp $AGENT_DATA/amgen/SPR_201103* $AGENT_DATA/AMGEN
amgen is directory .
AMGEN is file we are trying to creat.
for SPR_201103* 10 files are there
Please help me to how to achive this.... (2 Replies)
Discussion started by: ajaykumarkona
2 Replies
3. Shell Programming and Scripting
Hi,
I have mutiple csv files at server1 at /apps/test/data.
I needed a script that would copy these csv files from server1 at /usr/data, put them in server2,archive the earlier files that were present in server2 before removing those already present.
Kindly help. (2 Replies)
Discussion started by: Alok Ranjan
2 Replies
4. UNIX for Dummies Questions & Answers
Hey Guys,
I have directory with thousands of files, I need to copy only march data.
can any one please Help..........
Thanks,
Uttam N (4 Replies)
Discussion started by: Uttamnsd
4 Replies
5. UNIX for Dummies Questions & Answers
hi,
I am copying a file from 1 folder to another in /bin/sh. if the file already exists there, it should get copied as filename1. again if copying next time it shouldget copied as filename2.. , filename3..so on..
The problem is i am able to get uptil filename1.. but how do i know what... (6 Replies)
Discussion started by: blackcat
6 Replies
6. Shell Programming and Scripting
I have got an Perl array like:
@array = (1,2,3,4,5,6,1,2,3,4,1,2,1,2,3,4,5,6,7,8,9...............)
This numeric sequence will be always sequentially increasing, unless it encounters, The beginning of the new sequentially increasing numeric sequence.
SO in this array we get sequentially... (5 Replies)
Discussion started by: teknokid1
5 Replies
7. Shell Programming and Scripting
Hello,
I'm very new to scripting languages and I'm to use shell script to write a utility to backup files with a specific extension into a subdirectory.
Here is what I have done.
#!/bin/bash
read -p "Enter file(s) extension: " FILE
if ; then
mkdir `whoami`.$FILE #To... (9 Replies)
Discussion started by: alphanoob
9 Replies
8. Shell Programming and Scripting
Hello team,
We wish to develop a script as follows :
1. Rename multiple files in the following way:
example
Original file names : test.txt and dummy.txt
New file names : test.$(date +"%F").AAAAA<serialno_1>.BBBBBB.p and dummy.$(date +"%F").AAAAA<serialno_2>.BBBBBB.p
2. The... (3 Replies)
Discussion started by: H squared
3 Replies
9. Shell Programming and Scripting
Hi,
I have multiple files that read:
Asa.txt
Bad.txt
Gnu.txt
And I want to rename them using awk to
Asa_ddmmyytt.txt and so on
...
If there is a single command or more efficient executable please share!
Thanks! (4 Replies)
Discussion started by: Jesshelle David
4 Replies
10. Shell Programming and Scripting
Hi All,
i'm trying to copy the 1.txt files (sample files) in to different path location using the below command.
But it is not copying the files , when i tried for single location able to copy the file.
can any one please assist here.
Please find the below path :-
/ckr_mkr1/licencekey... (2 Replies)
Discussion started by: venkat918
2 Replies
CP(1) General Commands Manual CP(1)
NAME
cp - copy
SYNOPSIS
cp [ -ip ] file1 file2
cp [ -ipr ] file ... directory
DESCRIPTION
File1 is copied onto file2. By default, the mode and owner of file2 are preserved if it already existed; otherwise the mode of the source
file modified by the current umask(2) is used. The -p option causes cp to attempt to preserve (duplicate) in its copies the modification
times and modes of the source files, ignoring the present umask.
In the second form, one or more files are copied into the directory with their original file-names.
Cp refuses to copy a file onto itself.
If the -i option is specified, cp will prompt the user with the name of the file whenever the copy will cause an old file to be overwrit-
ten. An answer of 'y' will cause cp to continue. Any other answer will prevent it from overwriting the file.
If the -r option is specified and any of the source files are directories, cp copies each subtree rooted at that name; in this case the
destination must be a directory.
SEE ALSO
cat(1), mv(1), rcp(1C)
4th Berkeley Distribution June 8, 1985 CP(1)