Re: Copy a file one hundred times

2008-12-22 Thread Jörg-Volker Peetz
Tzafrir Cohen wrote: > On Sun, Dec 21, 2008 at 04:45:21PM -0600, Ron Johnson wrote: >> On 12/21/08 15:58, Jörg-Volker Peetz wrote: >>> $ seq -w 1 1 10 | xargs -i -n1 cp file.jpg file{}.jpg >> What's with the {}? An implied variable? > > $ LANG=C man xargs | grep -C 2 '{}' >-i[replace-str]

Re: Copy a file one hundred times

2008-12-21 Thread Slim Joe
2008/12/14, Rodolfo Medina : > I need the right syntax to copy file.jpg 100 times with one command so to > get > 100 files named file1.jpg, file2.jpg, ..., file100.jpg. > > Can anybody suggest how to achieve that? You could try something like: cat file.pdf | tee `seq -w 0 100 | sed 's+.*+file_&.p

Re: Copy a file one hundred times

2008-12-21 Thread Tzafrir Cohen
On Sun, Dec 21, 2008 at 04:45:21PM -0600, Ron Johnson wrote: > On 12/21/08 15:58, Jörg-Volker Peetz wrote: >> $ seq -w 1 1 10 | xargs -i -n1 cp file.jpg file{}.jpg > > What's with the {}? An implied variable? $ LANG=C man xargs | grep -C 2 '{}' -i[replace-str] This option i

Re: Copy a file one hundred times

2008-12-21 Thread Ron Johnson
On 12/21/08 15:58, Jörg-Volker Peetz wrote: Osamu Aoki wrote: On Sat, Dec 13, 2008 at 09:13:07PM +, Tzafrir Cohen wrote: On Sun, Dec 14, 2008 at 03:50:31AM +0900, Osamu Aoki wrote: On Sat, Dec 13, 2008 at 07:12:32PM +, Rodolfo Medina wrote: I need the right syntax to copy file.jpg 100

Re: Copy a file one hundred times

2008-12-21 Thread Jörg-Volker Peetz
Osamu Aoki wrote: > On Sat, Dec 13, 2008 at 09:13:07PM +, Tzafrir Cohen wrote: >> On Sun, Dec 14, 2008 at 03:50:31AM +0900, Osamu Aoki wrote: >>> On Sat, Dec 13, 2008 at 07:12:32PM +, Rodolfo Medina wrote: I need the right syntax to copy file.jpg 100 times with one command so to

Re: Copy a file one hundred times

2008-12-13 Thread H.S.
Thomas Preud'homme wrote: > filevar=$1 # The file to copy a hundred time > basefile=${filevar%.[^.]*} # We delete all the end from the last dot (eg > a dot followed by any others caracters) > extension=${filevar##^.*.} # We delete all the beginning until the last Just for refere

Re: Copy a file one hundred times

2008-12-13 Thread H.S.
Thomas Preud'homme wrote: > The Saturday 13 December 2008 20:12:32 Rodolfo Medina, you wrote : >> I need the right syntax to copy file.jpg 100 times with one command so to >> get 100 files named file1.jpg, file2.jpg, ..., file100.jpg. >> >> Can anybody suggest how to achieve that? >> >> Thanks for

Re: Copy a file one hundred times

2008-12-13 Thread H.S.
Rick Pasotto wrote: > > I forgot about seq. This is even better (the -w left pads with zero for > equal width): > > for x in $(seq -w 1 100); do cp file.jpg file${x}.jpg; done > correction^ Nice! Something I have been looking for quite some time. I was u

Re: Copy a file one hundred times

2008-12-13 Thread Osamu Aoki
On Sat, Dec 13, 2008 at 09:13:07PM +, Tzafrir Cohen wrote: > On Sun, Dec 14, 2008 at 03:50:31AM +0900, Osamu Aoki wrote: > > On Sat, Dec 13, 2008 at 07:12:32PM +, Rodolfo Medina wrote: > > > I need the right syntax to copy file.jpg 100 times with one command so to > > > get > > > 100 files

Re: Copy a file one hundred times

2008-12-13 Thread Manon Metten
Hi Rick, On Sat, Dec 13, 2008 at 7:41 PM, Rick Pasotto wrote: > I forgot about seq. This is even better (the -w left pads with zero for > equal width): > > for x in $(seq -w 1 100); do cp file.jpg file${c}.jpg; done Waw! Great one-liner. BTW: Guess you meant file${x}.jpg; Greetings, Manon.

Re: Copy a file one hundred times

2008-12-13 Thread Alex Samad
On Sat, Dec 13, 2008 at 09:13:07PM +, Tzafrir Cohen wrote: > On Sun, Dec 14, 2008 at 03:50:31AM +0900, Osamu Aoki wrote: > > On Sat, Dec 13, 2008 at 07:12:32PM +, Rodolfo Medina wrote: > > > I need the right syntax to copy file.jpg 100 times with one command so to > > > get > > > 100 files

Re: Copy a file one hundred times

2008-12-13 Thread Tzafrir Cohen
On Sun, Dec 14, 2008 at 03:50:31AM +0900, Osamu Aoki wrote: > On Sat, Dec 13, 2008 at 07:12:32PM +, Rodolfo Medina wrote: > > I need the right syntax to copy file.jpg 100 times with one command so to > > get > > 100 files named file1.jpg, file2.jpg, ..., file100.jpg. > > > > Can anybody sugge

Re: Copy a file one hundred times

2008-12-13 Thread Thomas Preud'homme
The Saturday 13 December 2008 20:12:32 Rodolfo Medina, you wrote : > I need the right syntax to copy file.jpg 100 times with one command so to > get 100 files named file1.jpg, file2.jpg, ..., file100.jpg. > > Can anybody suggest how to achieve that? > > Thanks for any reply > Rodolfo filevar="fil

Re: Copy a file one hundred times

2008-12-13 Thread Osamu Aoki
On Sat, Dec 13, 2008 at 07:12:32PM +, Rodolfo Medina wrote: > I need the right syntax to copy file.jpg 100 times with one command so to get > 100 files named file1.jpg, file2.jpg, ..., file100.jpg. > > Can anybody suggest how to achieve that? ere is one without looping :-) $ seq 1 100 | sed

Re: Copy a file one hundred times

2008-12-13 Thread John Hasler
Rodolfo writes: > I need the right syntax to copy file.jpg 100 times with one command so to > get 100 files named file1.jpg, file2.jpg, ..., file100.jpg. for I in {1..100}; do cp file.jpg file$I.jpg ; done But what are you actually trying to achieve? -- John Hasler -- To UNSUBSCRIBE, email to

Re: Copy a file one hundred times

2008-12-13 Thread Rick Pasotto
On Sat, Dec 13, 2008 at 07:35:44PM +0100, Manon Metten wrote: > Hi Rodolfo > > On Sat, Dec 13, 2008 at 8:12 PM, Rodolfo Medina > wrote: > > > I need the right syntax to copy file.jpg 100 times with one command so to > > get > > 100 files named file1.jpg, file2.jpg, ..., file100.jpg. > > > #!/

Re: Copy a file one hundred times

2008-12-13 Thread Manon Metten
Hi Rodolfo On Sat, Dec 13, 2008 at 8:12 PM, Rodolfo Medina wrote: > I need the right syntax to copy file.jpg 100 times with one command so to get > 100 files named file1.jpg, file2.jpg, ..., file100.jpg. #!/bin/bash for x in `seq 1 100`; do if [[ x -lt 10 ]]; then cp file.jpg file-00$x.

Re: Copy a file one hundred times

2008-12-13 Thread Rick Pasotto
On Sat, Dec 13, 2008 at 07:12:32PM +, Rodolfo Medina wrote: > I need the right syntax to copy file.jpg 100 times with one command so to get > 100 files named file1.jpg, file2.jpg, ..., file100.jpg. > > Can anybody suggest how to achieve that? c=0; while [ $c -lt 100 ]; do c=$[c + 1]; n='000'$