Re: Copy a file one hundred times



Osamu Aoki wrote:
On Sat, Dec 13, 2008 at 09:13:07PM +0000, 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 +0000, 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 :-)
<snip>
$ seq 1 100 | sed "s/^\(.*\)$/file\1.jpg/" |xargs -n1 cp file.jpg


And even shorter:

$ seq -w 1 1 10 | xargs -i -n1 cp file.jpg file{}.jpg

--
Regards,
Jörg-Volker.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: crash recovery
    ... I just experienced a complete freeze of my laptop - amarok was stuck ... looping through the same second of music from an online stream, ... I'm running Lenny with fluxbox, and had just done an aptitude update. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • RE: A host of person@redhat.com messages with virus attachements
    ... I fiddled yesterday with the settings in E2K3 and found myself the ... I am looping the messages now through a smack together ... To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list -- fedora-list mailing list ...
    (Fedora)
  • Re: Copy a file one hundred times
    ... ere is one without looping :-) ... Ron Johnson, Jr. ... Jefferson LA USA ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: Copy a file one hundred times
    ... ere is one without looping :-) ... err.. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Copy a file one hundred times
    ... ere is one without looping :-) ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)