From: Sean Johnston <sean.johnston@xenicom.com>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: RE: Getting a particular char
Date: Fri, 6 Aug 2004 12:24:41 +0100 [thread overview]
Message-ID: <E03A29079728AA40BFB53A818DE02C30B23AC3@exchange.xenicom.net> (raw)
From: DervishD [mailto:raul@pleyades.net]
Sent: 06 August 2004 11:56
> So I'm implementing it like that:
>
> # Dirty and ugly hack, needs some polishing...
> # First we get rid of all characters at the beginning
> while [ ${#parameter} -gt n ]
> do
> parameter=${parameter#?}
> done
>
> # Now, get rid of the characters after
> # the one we are interested in
>
> while [ ${#parameter} -gt 1 ]
> do
> parameter=${parameter%?}
> done
>
> I would like another ideas, shorter, faster, or simply less ugly,
> and it must be portable, so no zsh tricks :(( If you could please
> help me... Thanks a lot in advance.
>
How about:
parameter=`echo "$parameter" | cut -cn`
Sean.
_____________________________________________________________________
This message has been checked for all known viruses by Xenicom delivered through the MessageLabs Virus Control Centre.
next reply other threads:[~2004-08-06 11:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-06 11:24 Sean Johnston [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-08-06 10:55 DervishD
2004-08-10 11:51 ` DervishD
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=E03A29079728AA40BFB53A818DE02C30B23AC3@exchange.xenicom.net \
--to=sean.johnston@xenicom.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).