From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-users-return-23618-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id ce708e58 for ; Wed, 12 Sep 2018 01:29:10 +0000 (UTC) Received: (qmail 23731 invoked by alias); 12 Sep 2018 01:28:56 -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: List-Unsubscribe: X-Seq: 23618 Received: (qmail 21000 invoked by uid 1010); 12 Sep 2018 01:28:56 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f47.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.221.47):SA:0(-1.9/5.0):. Processed in 2.451181 secs); 12 Sep 2018 01:28:56 -0000 X-Envelope-From: luomat@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=b7njFrtDTzSHsvFtdqw7iN785Qjrv1/yaNpI7Fzfehk=; b=uTJWcSZFSt8s+EH4S64oGgMwvJEMHRxKOeAIbcqpmYK2DScRP03OG7WL3lHeUXWMTH 1nKcb5I5USwpCONiJfAbdNhhbCEaJrcZyZLZvYmVq8UzjdRSWhQWa6vVfstDHqKkCESy NkuQsBMVxnSRM8xOMnyUf7riRfVjV5WqdxZtDXmUgb5NonHojkgJxJanaVUOZ/ixKdkM ZBfNbfcEZlq2A0PShnjhc59Im8Fx11oIibvMfiNXbB79mw1jB3KdH5ahACGwl/bRva3Q PxQXcwuZYW1FqU7yJhq8g1ZIezr+xiemdBYacorKqqMA1UhSITDV1Nn40DNVdN1HrVLk 5CYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=b7njFrtDTzSHsvFtdqw7iN785Qjrv1/yaNpI7Fzfehk=; b=Nyi8LhnaChL2aYUYIGGvt7d1P+yupBfGGgDJoh9g9Yg+j9RtPWga6cHK0s2FMcE94X r7KlakVOryLXcfSR3IMDJ6OlXaOc+1wqP0KFecxS9Qbc4eFZtG1H3A6/AK0sxUBuD9Lu VDl4r/77s2GzHnMYOFotLDY3DY1E0HPWjy7V/sApTkYCP5DyFSJ8hMtoxAsQCIXchuyi R//uU/c8a3XcM3xCpHqodGTHjDSEj0RgOITRYQeDPtQJ/0Azupfu+g+qjpMGKFgipJgt LsSLhdo+joJf69WOPjZys/7i0PimR0jWtY5Ti7kz6Z56Zl7E3MPRRbD8sedGiTjo9DTc NrFg== X-Gm-Message-State: APzg51AnAQlqmQSIJ73koO5SYQwknb22pAhGZBnauuVJtiBxEJOT90MO DWOg1jaLH/ZUeQ4HpbVtMN6W0gUNQpvnyNMUe5dX6OEc X-Google-Smtp-Source: ANB0Vda+2GjbsLjqTT1dt66wdGhBZvojwaLybiUjsf7PVVXzBIArUY7Q+gqgNMQHCHMKwH8udYRrXOM+h8vp0q5jdoc= X-Received: by 2002:adf:afd3:: with SMTP id y19-v6mr20505849wrd.176.1536715728958; Tue, 11 Sep 2018 18:28:48 -0700 (PDT) MIME-Version: 1.0 From: TJ Luoma Date: Tue, 11 Sep 2018 21:28:11 -0400 Message-ID: Subject: removing spaces in variables when using :t or :r or similar To: Zsh-Users List Content-Type: multipart/alternative; boundary="0000000000002538780575a283a0" --0000000000002538780575a283a0 Content-Type: text/plain; charset="UTF-8" Let's use this variable as an example: INSTALL_TO='/Applications/Keyboard Maestro.app' Now, if I want to get just "keyboard maestro" I can use this: $INSTALL_TO:t:r:l But what if I want "keyboardmaestro" ? I tried this: echo "${INSTALL_TO:t:r:l// /}" but that just produced this error: zsh: unrecognized modifier I realize I could do this: FOO="${INSTALL_TO// /}" echo "$FOO:t:r:l" but I'd rather avoid using a second variable, if I can avoid it. Is there a way to do that with zsh, or am I stuck just sending it to `tr -d ' '` ? Thanks! TjL -- TJ Luoma TJ @ MacStories Personal Website: luo.ma (aka RhymesWithDiploma.com) Twitter: @tjluoma --0000000000002538780575a283a0--