From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21325 invoked by alias); 25 Feb 2015 20:50:53 -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: 19923 Received: (qmail 3769 invoked from network); 25 Feb 2015 20:50:40 -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,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=2badqR/0gNvvG+gxB+bhwIbgL4atKFTI4/2SQdUBq3E=; b=wR/S/ODwS7K055TgOD6mNNa7xM9doqIcuXP3ANvt6w0vgaJsoHIusUw1KMGFFOteW7 ETl4lregMfrxII0VwTrEOiCr9tiBNBJtuia7xx6NtGTExjwG397vjfXjK+/TYDBD9Ktn QDGyRbvjSP/wf4lXEI7aduOUwiOZZc68NL5gWdCcJI0acuvQhS1E48rM4c4H3mlVTNIc ucBLmUJOM4DKHUAYmmjcyvf+kqPcXLKF82ntWgVSDHtEm/WWMwtKtUK3Td+ZXKWqMtCR OqYiF2lgRF2a+OG1b3ybsaNWNconpYtpKs8mLVUC25JpS7Q9TorSR5reqoyhJt+Y/ptM 1v1Q== X-Received: by 10.182.128.199 with SMTP id nq7mr3596669obb.47.1424897436829; Wed, 25 Feb 2015 12:50:36 -0800 (PST) MIME-Version: 1.0 Sender: akkartik@gmail.com From: Kartik Agaram Date: Wed, 25 Feb 2015 12:50:16 -0800 X-Google-Sender-Auth: 9TS3ovxowU5cVC-OwDO4bUuArXE Message-ID: Subject: parameter expansion with '$' To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=089e01537e76904f04050fefc997 --089e01537e76904f04050fefc997 Content-Type: text/plain; charset=UTF-8 Hi, Consider this example: $ X=abc $ echo ${X/c/} ab However, I'd like to only perform the substitution when 'c' occurs at the end of the string: $ echo ${X/c$/} abc # I'd like this to return 'ab' like above I assume others see the same results? Can anybody help me understand why it doesn't work, and how I can interpret the '$' as a regular expression wildcard rather than some other sort of zsh sigil? Thanks, Kartik zsh 5.0.5 on x86_64 with extendedglob --089e01537e76904f04050fefc997--