Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14157

Re: extglob patterns not expanded in -c command-strings

Path csiph.com!feeder.erje.net!2.us.feeder.erje.net!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Paulo Marcel Coelho Aragão <marcelpaulo@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: extglob patterns not expanded in -c command-strings
Date Sun, 27 May 2018 22:42:20 -0300
Lines 11
Approved bug-bash@gnu.org
Message-ID <mailman.606.1527471745.1292.bug-bash@gnu.org> (permalink)
References <5b0b4173.1c69fb81.6c66f.f11f@mx.google.com> <3e47e63b-7dd9-3e90-3067-8304111170a8@case.edu>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1527471746 17607 208.118.235.17 (28 May 2018 01:42:26 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org, bash@packages.debian.org
To Chet Ramey <chet.ramey@case.edu>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rjncuuZSUWR/Xmsq4qA4eoP5MyZRWDU9P94QZC88dQo=; b=qKKU0sTqZ6d9IOQeqGFUH9oti+OpA59KqhYjJ/oB+K6M7n2+Zy/le9Q0qiLuh3x77F UhbMmheQrBvKmV7JOcjhooMyBgFUc/m7GRwFPuHsrRinutfywVGslUqDmMdzFXplPo2w SXANVBDaoEpC/h5XeovlM+hNnExPy30yxn5osrT0NLqa7csQIDBlF3mZinpkMyI4N9fh ClLYhoHZKwF3jeVwkEHvf568ZuzZU4iXvXVSKrzGhyn77n5cVzs2yIa36dWGdVMOj/bg uW2wtsD61dVK9aawJlh+YegOSaRhzrgsXllVffWLY5RVS3IS2AVCrtH5Zh18vIyoY606 Oxww==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rjncuuZSUWR/Xmsq4qA4eoP5MyZRWDU9P94QZC88dQo=; b=japzphiPfJyuFZPcaiD7rE4rw8Hz7J5MKXUZO/ilNcwlDBZUDsNZu1mQF9JoP3zRB+ V9IxXwZaRbQrt7hfIADXLC71pzw/GPdioKGw6YSQiHWhFzZq9obQMWg5xDRIS5q0B8T7 0x0Zb4C/kP7s8lP9tSG4sziS2WwehGZE360O6qgFwsTNOsE1MpHDsiEb+cJ6YDWu/0mC MonHCrHOmDDuQhtghi8d/jT/2H8sihS3MD2sEutht11pyv9eLlSQfvhqMmKmK3eic1YX PVgkYYJfUAx5IZFjXmrfc7KNAxBD59RGkAHqM1pxV59b8cmmQdpQo+tg3vmsxYLEdVMX Z4Tg==
X-Gm-Message-State ALKqPwe1Oh08hnBvrDFeVk7apWY3nkvWwP4uxflcRs/XOJ8j0UtWjnRR DwG1dMIQo1J/kkToDVJ9OyM=
X-Google-Smtp-Source ADUXVKLRKf+ETFtax86urWsvWb5hHn+aXkEgTKdf5O/fUzNtGvtL5ImIN76w0MuNNgbYTet+laMyCA==
X-Received by 2002:a0c:dd11:: with SMTP id u17-v6mr10522370qvk.237.1527471743030; Sun, 27 May 2018 18:42:23 -0700 (PDT)
Content-Disposition inline
In-Reply-To <3e47e63b-7dd9-3e90-3067-8304111170a8@case.edu>
User-Agent NeoMutt/20171215
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2607:f8b0:400d:c0d::233
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14157

Show key headers only | View raw


> If you apply that rule, you can figure out the answer: extglob changes the
> behavior of the parser, so it must be enabled before a command is parsed.
> The complete line of input is read before any of it is parsed, and the
> complete line is parsed before any of it is executed. As a consequence, the
> extglob option must be enabled for the ( to be recognized as an extended
> globbing pattern instead of an operator.

I replied before reading your answer, my apologies. You unvealed the mystery ! Now I understand why it works as expected with -O extglob: it enables it BEFORE parsing the command.

Thank you so much for shedding light on this !

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: extglob patterns not expanded in -c command-strings Paulo Marcel Coelho Aragão <marcelpaulo@gmail.com> - 2018-05-27 22:42 -0300

csiph-web