From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27218 invoked by alias); 30 Jul 2014 03:12:52 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18998 Received: (qmail 14155 invoked from network); 30 Jul 2014 03:12:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:content-type; bh=kzb6JSLy0eq4HASYyvzjKtVWchfR7P+BOz6JpQwpe/U=; b=JjqPwr6QgfBTiHREjPE8f8aOh3KNoxzqBsxm0/eKOs1IQhlaQP/6QjqKUoTZEq0Q1y abr1bppc6F/fRzp+7Zopd5w/jnT4QjkphB2P9WM9jcx2xAi3qmB2VmXgDjQJ00MNXpzQ yusbH2Jsyb1DBm7VXIKJV2JAtvIR2HpBYNb6VfhOaMFVxNTyfhJbY/ssie+SGEaHUNmP zCSwZci1MHGUoDHdjy5b30uQQlOHGBc6EbDQ1slBwdb+MBjxXlqjkuarx3NnPurpvgrz lGrhcSywt1D1Auiv+x20NOo0slpCLO90oPn6juSZyrfLn/zkfqlTpEz6iBMQnD85le4v tjwA== X-Gm-Message-State: ALoCoQlwlmqhGp8l0MxQxfpMup5AuzrkrAGtwRXz8ZilRb1aiuOVUyRviWcHjOA7s0SYOfxTymt1 MIME-Version: 1.0 X-Received: by 10.220.166.9 with SMTP id k9mr1135273vcy.20.1406689954320; Tue, 29 Jul 2014 20:12:34 -0700 (PDT) Sender: benizi@benizi.com Date: Tue, 29 Jul 2014 23:12:34 -0400 X-Google-Sender-Auth: JJqPYAKZsij3mmiYjeIFwzEgRCg Message-ID: Subject: Repeat argument N times? From: "Benjamin R. Haskell" To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=047d7b3a8ae6096cc804ff60871b --047d7b3a8ae6096cc804ff60871b Content-Type: text/plain; charset=UTF-8 Is there a built-in way to repeat an argument N times? Brace expansion is something I fall back on too much, so I've gotten in the habit of using it for small values of N, e.g. with a script I use to test uploading files to a web app: upload-files file1{,,} file2{,}{,,,,} file3{,,,} uploads 3 copies of file1, 10 copies of file2, and 4 copies of file3. It'd be nice if I could write (something like): upload-files file1(N3) file2(N10) file3(N4) Today I found myself writing: upload-files file1{,}{,,,,}{,}{,,,,} And while it's nice to know I can factor 100, it'd be nicer to just write it. -- Best, Ben --047d7b3a8ae6096cc804ff60871b--