zsh-users
 help / color / mirror / code / Atom feed
From: "Com MN PG P E B Consultant 3" <mn-pg-p-e-b-consultant-3.com@siemens.com>
To: "zsh-users Mailinglist" <zsh-users@sunsite.dk>
Subject: substring extraction
Date: Mon, 8 May 2006 09:32:50 +0200	[thread overview]
Message-ID: <6F0CB04509C11D46A54232E852E390AC0155A876@MCHP7R6A.ww002.siemens.net> (raw)

bash has the nice feature to extract a substring from a shell variable.
For example

   # bash example
   var=abcd
   echo ${var:1:2} # Start at offset 1, returns 2 characters

displays 

   bc

Is there an easy way to achieve a similar effect in zsh, without
reverting to external
tools such as awk or sed?

Ronald
 


             reply	other threads:[~2006-05-08  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-08  7:32 Com MN PG P E B Consultant 3 [this message]
2006-05-08  8:07 ` Stephane Chazelas
2006-05-08 15:29   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6F0CB04509C11D46A54232E852E390AC0155A876@MCHP7R6A.ww002.siemens.net \
    --to=mn-pg-p-e-b-consultant-3.com@siemens.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).