It would be easy enough to do with a language like Ruby or Python. Get a dir
glob, take a slice out of the array, iterate over that slice to copy files.

On Thu, Jan 27, 2011 at 10:55 AM, Travis Paul <[email protected]> wrote:

> You're right I responded without really thinking about what I had sent...
>
> incrementing the variable is easy enough:
>
> #!/bin/bash
>
> counter=0
>
> while [  $counter -lt 10 ]; do
>
>   cp ./samples/*.bla
>
>   let counter=counter+1
>
> done
>
> but keeping track of which files have been transferred is a bit more work
>
> ...expanding on the above snippet you could store a list of files in a text
> file
> iterate over the lines then remove them from the list once they have been
> copied over, that doesn't sound very elegant though
>
> On Thu, Jan 27, 2011 at 10:45 AM, Christer Watson <
> [email protected]> wrote:
>
>> a couple questions. don't you need to increment the $counter variable?
>> Don't you need to use the $counter variable to choose just one item
>> from a list of files in the /samples directory?
>>
>> Cheers,
>>
>> --Christer
>>
>>
>> On Thu, Jan 27, 2011 at 10:39 AM, Travis Paul <[email protected]> wrote:
>> > ye olden bash loops...
>> >
>> >          #!/bin/bash
>> >          counter=0
>> >          while [  $counter -lt 10 ]; do
>> >              cp ./samples/*.bla
>> >          done
>> >
>> > On Thu, Jan 27, 2011 at 10:34 AM, Jonathan Bartels
>> > <[email protected]> wrote:
>> >>
>> >> I have a large batch of sample data files that are run through an
>> >> application by copying them to an 'inbox' directory. I would like to
>> >> do something like this:
>> >>
>> >> cp ./samples/*.bla --limit 10
>> >>
>> >> So that only 10 of the sample files are copied instead of the whole
>> >> mess of 10000. It can be any files. I checked the manpage and didn't
>> >> see anything.
>> >>
>> >> Any ideas?
>> >>
>> >> --
>> >> -----
>> >> Jonathan Bartels
>> >>
>> >> _______________________________________________
>> >> Fwlug mailing list
>> >> [email protected]
>> >> http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org
>> >>
>> >> This is a public list and all posts are archived publicly. Please keep
>> >> this in mind before posting.
>> >
>> >
>>
>> _______________________________________________
>> Fwlug mailing list
>> [email protected]
>> http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org
>>
>> This is a public list and all posts are archived publicly. Please keep
>> this in mind before posting.
>>
>
>
> _______________________________________________
> Fwlug mailing list
> [email protected]
> http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org
>
> This is a public list and all posts are archived publicly. Please keep this
> in mind before posting.
>
>


-- 
Matt Mayers
[email protected]
http://mattmayers.com/
_______________________________________________
Fwlug mailing list
[email protected]
http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org

This is a public list and all posts are archived publicly. Please keep this in 
mind before posting.

Reply via email to