From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22688 invoked by alias); 22 May 2016 10:30:08 -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: 21588 Received: (qmail 6226 invoked from network); 22 May 2016 10:30:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Date: Sun, 22 May 2016 12:22:18 +0200 From: Roman Neuhauser To: Sebastian Gniazdowski Cc: Zsh Users Subject: Re: Truncate strings in array Message-ID: <20160522102218.GF3514@isis.sigpipe.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) # sgniazdowski@gmail.com / 2016-05-22 09:20:10 +0200: > having array of strings, is it possible to nicely truncate the strings > to given length? Could iterate the array and do truncation, but maybe > there's a one liner? print -l ${strings/(#m)*/$MATCH[1,30]} -- roman