zsh-users
 help / color / mirror / code / Atom feed
From: rahul <rahul2012@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh-users@zsh.org
Subject: Re: array matching: inconsistent behaviour ?
Date: Wed, 9 Jan 2013 16:03:52 +0530	[thread overview]
Message-ID: <CACQNQ9Nk0=CTGacByEZJYsURZViLSksQ5z-2PfJVvW8LgtTP3w@mail.gmail.com> (raw)
In-Reply-To: <20130109094054.021cbaa6@pwslap01u.europe.root.pri>

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]

On Wed, Jan 9, 2013 at 3:10 PM, Peter Stephenson

> You're not exactly doing anything wrong, but quoting here has alwas been
> a bit funny to allow (some forms of) pattern matching.  To ensure an
> exact string match you can use the (e) flag...
>
> % print $FOO[(ie)$x]
> 1
> % print $FOO[(ie)$y]
> 2
>
> pws
>

My apologies. There's just so much zsh provides, it's difficult for a
newcomer to keep it all in the head even though I have printouts next to
me. You've done an awesome job with zsh!

I've been using the "print -rC" to print in columns -- saves me from quite
a bit of programming. However, often the data has spaces in it, or tabs. Of
course, print will wrap/break on those. So i found a hack to use "tr" to
replace spaces and tabs with ^a and ^b before feeding to "print" and then
doing the reverse after "print" gives the output. However, putting the
spaces back after "print" has done its formatting means that the alignment
is disturbed by the spaces.

I tried to change the IFS to newlines before calling print, but it seems
"print" does not use IFS to wrap/split lines into columns. Is there some
direct way to prevent "print -rC" from wrapping on spaces and tabs.

-- 
 rahul

  reply	other threads:[~2013-01-09 10:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09  6:30 rahul
2013-01-09  9:35 ` Han Pingtian
2013-01-09 10:23   ` rahul
2013-01-09  9:40 ` Peter Stephenson
2013-01-09 10:33   ` rahul [this message]
2013-01-09 15:56     ` Bart Schaefer
2013-01-09 16:53       ` rahul

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='CACQNQ9Nk0=CTGacByEZJYsURZViLSksQ5z-2PfJVvW8LgtTP3w@mail.gmail.com' \
    --to=rahul2012@gmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-users@zsh.org \
    /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).