[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread miss-islington
miss-islington added the comment: New changeset 0f66498fd8ee8644be6df963b86a1523f6069ddd by Paul Ganssle in branch 'master': bpo-42874: Remove grep -qE options for Solaris 10 compatibility (GH-24200) https://github.com/python/cpython/commit/0f66498fd8ee8644be6df963b86a1523f6069ddd

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Martin Wheatley
Martin Wheatley added the comment: I'll do the test it happens with a plain ./configure Many thanks Martin On Tue, 12 Jan 2021 at 15:11, Paul Ganssle wrote: > > Paul Ganssle added the comment: > > This particular grep statement is used to validate the `tzpath` variable.

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Martin Wheatley
Martin Wheatley added the comment: I'll do the test it happens with a plain ./configure Many thanks Martin On Tue, 12 Jan 2021 at 15:11, Paul Ganssle wrote: > > Paul Ganssle added the comment: > > This particular grep statement is used to validate the `tzpath` variable.

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Paul Ganssle
Paul Ganssle added the comment: This particular grep statement is used to validate the `tzpath` variable. Apparently it is easy enough to achieve what I was going for using vanilla grep with no options, so I've created GH-24200 to fix the issue. I notice that there are other uses of `-q

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +23025 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24200 ___ Python tracker ___

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-11 Thread Christian Heimes
Christian Heimes added the comment: Paul, please take a look. You added the code in commit 62972d9d73e. -- nosy: +christian.heimes, p-ganssle ___ Python tracker ___

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-10 Thread Ned Deily
Change by Ned Deily : -- components: +Build -Installation ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-10 Thread Ned Deily
Change by Ned Deily : -- title: configure errors -> running configure on Solaris 10 gives grep "illegal option" errors ___ Python tracker <https://bugs.pytho

[issue27224] IDLE: editor versus grep line number differ

2019-03-22 Thread Terry J. Reedy
Change by Terry J. Reedy : -- assignee: -> terry.reedy components: +IDLE ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36323] IDLE: always display full grep path

2019-03-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thanks. I somehow never marked it for IDLE. Using groupby components, I discovered another +-10 and marked them and included in my list. -- ___ Python tracker

[issue36323] IDLE: always display full grep path

2019-03-20 Thread Cheryl Sabella
Cheryl Sabella added the comment: See also #21960. I'm going to close that one in favor of this issue. -- ___ Python tracker ___

[issue36323] IDLE: always display full grep path

2019-03-17 Thread Emmanuel Arias
Change by Emmanuel Arias : -- nosy: +eamanu ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36323] IDLE: always display full grep path

2019-03-16 Thread Terry J. Reedy
change in an undocumented way. There is currently no way in a grep output to determine which directory was searched. This is especially annoying when there are no hits and one knows that there should be some. My initial thought was to prefix '*.py' with the directory of sys.executable

[issue36323] IDLE: always display full grep path

2019-03-16 Thread Terry J. Reedy
, the initial entry is the full path. A full path is much more useful and should always be given. -- assignee: terry.reedy components: IDLE messages: 338115 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: always display full grep path type: behavior

[issue23216] IDLE grep/find/replace source code needs docstrings

2019-03-16 Thread Cheryl Sabella
Change by Cheryl Sabella : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue23216] IDLE grep/find/replace source code needs docstrings

2019-03-16 Thread miss-islington
miss-islington added the comment: New changeset b34f1aa81433d60aee7bd744352b347dd650ca84 by Miss Islington (bot) in branch '3.7': bpo-23216: IDLE: Add docstrings to search modules (GH-12141) https://github.com/python/cpython/commit/b34f1aa81433d60aee7bd744352b347dd650ca84 -- nosy:

[issue23216] IDLE grep/find/replace source code needs docstrings

2019-03-16 Thread miss-islington
Change by miss-islington : -- pull_requests: +12336 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue23216] IDLE grep/find/replace source code needs docstrings

2019-03-16 Thread Cheryl Sabella
Cheryl Sabella added the comment: New changeset 0bb5e75cf8bc9b197ffb91cba6f30543ed502708 by Cheryl Sabella in branch 'master': bpo-23216: IDLE: Add docstrings to search modules (GH-12141) https://github.com/python/cpython/commit/0bb5e75cf8bc9b197ffb91cba6f30543ed502708 --

[issue23216] IDLE grep/find/replace source code needs docstrings

2019-03-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: There are several minor things to fix after this (and multiple issues), including the difference between find in search and replace. It seems to me that is should be the same. We will definitely need to test changes on both Windows and Linux. The font

[issue23216] IDLE grep/find/replace source code needs docstrings

2019-03-02 Thread Cheryl Sabella
Cheryl Sabella added the comment: I've created the first PR for docstrings on replace. Saimadhav Heblikar had added some docstrings under issue 21676, so I expanded on what he did. I referred to Al's diff, but didn't use it much since there were already some docstrings. For readability, I

[issue23216] IDLE grep/find/replace source code needs docstrings

2019-03-02 Thread Cheryl Sabella
Change by Cheryl Sabella : -- pull_requests: +12142 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue23216] IDLE grep/find/replace source code needs docstrings

2019-02-24 Thread Cheryl Sabella
Change by Cheryl Sabella : -- assignee: -> cheryl.sabella ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23216] IDLE grep/find/replace source code needs docstrings

2019-02-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Current module names, docstring status, and note. grep - present, some args not doc'ed replace - spotty; do not repetively doc 'event=None' args search - ditto searchbase - present searchengine - present; do not separately docstring 'isxyz' wrappers Closing

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-12 Thread Chris Angelico
On Mon, Nov 12, 2018 at 11:20 PM Anssi Saari wrote: > > Chris Angelico writes: > > > On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote: > >> > >> Chris Angelico writes: > >> > >> > No helper needed. Safe against command injection. Uses the known > >> > format of the command's output; if you

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-12 Thread Anssi Saari
Chris Angelico writes: > On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote: >> >> Chris Angelico writes: >> >> > No helper needed. Safe against command injection. Uses the known >> > format of the command's output; if you want other information as well >> > as the type, you could get that too.

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-09 Thread Cousin Stanley
srinivasan wrote: > Even after changing as per the below > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > or: > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' > or: > "blkid -o export %s | grep \"TYPE\" | cut -d\"=

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-09 Thread Chris Angelico
On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote: > > Chris Angelico writes: > > > No helper needed. Safe against command injection. Uses the known > > format of the command's output; if you want other information as well > > as the type, you could get that too. > > Can someone let me in on

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-09 Thread Anssi Saari
Chris Angelico writes: > No helper needed. Safe against command injection. Uses the known > format of the command's output; if you want other information as well > as the type, you could get that too. Can someone let me in on this secret helper module? Doesn't seem to match the helper module in

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
I feel I have kick started my learning in python :) Have a great day ahead! On Wed, Nov 7, 2018 at 3:11 PM Ben Bacarisse wrote: > srinivasan writes: > > > Even after changing as per the below > > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > > or:

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Ben Bacarisse
srinivasan writes: > Even after changing as per the below > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > or: > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' > or: > "blkid -o export %s | grep \"TYPE\" | cut -d\"

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Chris Angelico
On Wed, Nov 7, 2018 at 11:42 PM srinivasan wrote: > > Some I managed to fix temporarily as below, might be useful for others. Also > please correct me if anything wrong or for any improvements in the below > > cmd = "blkid -o export %s" % partition_path > out =

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
rote: > > > Even after changing as per the below > > > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > > > or: > > > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' > > > or: > > > "blkid -o export %s | grep \&

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Chris Angelico
On Wed, Nov 7, 2018 at 11:36 PM Qian Cai wrote: > > srinivasan wrote: > > Even after changing as per the below > > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > > or: > > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' >

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Qian Cai
srinivasan wrote: > Even after changing as per the below > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > or: > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' > or: > "blkid -o export %s | grep \"TYPE\" | cut -d\"=

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
Even after changing as per the below "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" or: 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' or: "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3" Still my output is: */dev/mmcbl

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Brian J. Oney via Python-list
On Wed, 2018-11-07 at 10:22 +0100, srinivasan wrote: > blkid -o export %s | grep \'TYPE\' | cut -d\"=\" -f3 You don't need to escape the single quotes. Try either: "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" or: 'blkid -o export %s | grep "TYPE" | cut -

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread srinivasan
After changing the line to *"cmd = "blkid -o export %s | grep \'TYPE\' | cut -d\"=\" -f3" % fs"*, Now I dont see the error "SyntaxError: can't assign to literal" This is not returning exactly "*vfat*" instead of this, it is returning as "*

Re: SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-06 Thread Rhodri James
On 06/11/2018 18:10, srinivasan wrote: root:~/qa/test_library# python3 sd.py File "sd.py", line 99 *cmd = "blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)* * ^* *SyntaxError: can't assign to literal* Look at the 'cut' element of the p

SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-06 Thread srinivasan
:return: filesystem type as string or None if not found """ *cmd = "blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)* *return self._helper.execute_cmd_output_string(cmd)* *def execute_cmd_output_string(self, cmd, enable_

Re: how to grep

2017-08-04 Thread dieter
Iranna Mathapati <iranna.gan...@gmail.com> writes: > How to grep values from below out put string. > > pattern should include "Fabric Module". One possible way would be to use a regular expression -- see the documentation for the "re" module. -- https://mail

Re: how to grep

2017-08-04 Thread Steve D'Aprano
On Fri, 4 Aug 2017 10:33 pm, Iranna Mathapati wrote: > Hi Team, > > How to grep values from below out put string. > > pattern should include "Fabric Module". > > grepping Fabric module values only > > str = ''' > 22 0Fabric Module

how to grep

2017-08-04 Thread Iranna Mathapati
Hi Team, How to grep values from below out put string. pattern should include "Fabric Module". grepping Fabric module values only str = ''' 22 0Fabric Module J8N-C9508-FM ok 24 0Fabric ModuleJ8N-C9508-FM

Re: Using re to perform grep functionality in Python

2017-03-01 Thread Michael Torrie
On 03/01/2017 02:55 PM, rob...@forzasilicon.com wrote: > Obviously, not what I want. Can anyone feed some input? You've already got some good answers, but I just wanted to point you at this good resource: http://www.dabeaz.com/generators/ Pretty much anything you do in a shell script that

Re: Using re to perform grep functionality in Python

2017-03-01 Thread Cameron Simpson
n cron. The script uses an external call to grep via subprocess, but I would like to internalize everything to run in Python. I've read that re can accomplish the filtering, but I am having trouble getting it to duplicate what I already have. # USING EXTERNAL GREP # # displa

Re: Using re to perform grep functionality in Python

2017-03-01 Thread robert
Thanks, Chris. That was nice and easy and very simple. -- https://mail.python.org/mailman/listinfo/python-list

Re: Using re to perform grep functionality in Python

2017-03-01 Thread Chris Angelico
s it to a mail script in cron. The > script uses an external call to grep via subprocess, but I would like to > internalize everything to run in Python. I've read that re can accomplish the > filtering, but I am having trouble getting it to duplicate what I already > have. > &g

Using re to perform grep functionality in Python

2017-03-01 Thread robert
Hi All, I'm relatively new to Python, and I am having some trouble with one of my scripts. Basically, this script connects to a server via ssh, runs Dell's omreport output, and then externally pipes it to a mail script in cron. The script uses an external call to grep via subprocess, but I

[issue27224] IDLE: editor versus grep line number differ

2016-06-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: Yesterday, I grepped three times and got the same wrong result each time, so I know I was not crazy. But today, starting fresh with no IDLE or TortoiseHg running, all is well. Closing as 'heisenbug' ;-). Lesson: start fresh before reporting weird behavior.

[issue27224] IDLE: editor versus grep line number differ

2016-06-05 Thread Ned Deily
Ned Deily added the comment: FWIW, using an IDLE built from the current top-of-trunk default (on OS X), the steps outlined above produce the correct result, 226 and 236, which match up with what other tools report. -- nosy: +ned.deily ___ Python

[issue27224] IDLE: editor versus grep line number differ

2016-06-04 Thread Terry J. Reedy
he first 4 line numbers are correct. The last two should be 232 and 236 to match the editor. Or the editor numbers should be 226 and 230 to match grep. I have not yet tried to cound to see which is correct, or look to see if there are long or continued lines that might throw one count off. I s

Re: What does “grep” stand for?

2015-11-06 Thread Larry Hudson via Python-list
On 11/06/2015 05:25 AM, William Ray Wing wrote: On Nov 5, 2015, at 10:36 PM, Larry Hudson via Python-list wrote: [snip] You’re not REALLY an old timer unless you’ve used TECO. -Bill Agreed. I'm not really and old-timer, just old (I'm 78). My first exposure to

Re: What does ???grep??? stand for?

2015-11-06 Thread Grant Edwards
On 2015-11-06, Dennis Lee Bieber wrote: > On Thu, 5 Nov 2015 20:19:39 + (UTC), Grant Edwards > declaimed the following: > >>Though I used a line-editor for a while on VMS, I was never very good >>at it, and abanded it for a full-screen editor at

Re: What does “grep” stand for?

2015-11-06 Thread William Ray Wing
> On Nov 5, 2015, at 10:36 PM, Larry Hudson via Python-list > wrote: > > On 11/05/2015 05:18 PM, Dennis Lee Bieber wrote: >> On Thu, 5 Nov 2015 20:19:39 + (UTC), Grant Edwards >> declaimed the following: >> >>> Though I used a line-editor

Re: What does “grep” stand for?

2015-11-05 Thread Chris Angelico
On Thu, Nov 5, 2015 at 6:32 PM, Christian Gollwitzer wrote: > The point I'm so amused is, that MS has not felt the need to ship a real > editor, and also cut back on most of the other tools that make computing, > even on commandlines, a pleasant experience. Readline?

Re: What does “grep” stand for?

2015-11-05 Thread Grant Edwards
On 2015-11-05, Random832 wrote: > Chris Angelico writes: >> As someone who grew up on MS-DOS, I'd like to mention that EDLIN's >> value wasn't in the obvious places. There were two features it had >> that most other editors didn't: firstly, it would

Re: What does “grep” stand for?

2015-11-05 Thread Grant Edwards
On 2015-11-05, Random832 wrote: > Grant Edwards writes: >> On 2015-11-05, Random832 wrote: >>> Of course, both of those things are also true of ed. >> >> Well, maybe not for you. I knew people who (yonks ago) used 'ed'

Re: What does “grep” stand for?

2015-11-05 Thread Random832
Grant Edwards writes: > On 2015-11-05, Random832 wrote: >> Of course, both of those things are also true of ed. > > Well, maybe not for you. I knew people who (yonks ago) used 'ed' for > regular file editing. And I remember using the VMS

Re: What does “grep” stand for?

2015-11-05 Thread Dan Sommers
On Thu, 05 Nov 2015 19:36:11 -0800, Larry Hudson wrote: > Anyone besides me remember the CP/M editor Mince (Mince Is Not > Complete EMACS)? It was an emacs-like editor, without any e-Lisp or > other way of extending it. I believe it was my first exposure to a > screen-oriented editor. I quite

Re: What does “grep” stand for?

2015-11-05 Thread Larry Hudson via Python-list
On 11/05/2015 05:18 PM, Dennis Lee Bieber wrote: On Thu, 5 Nov 2015 20:19:39 + (UTC), Grant Edwards declaimed the following: Though I used a line-editor for a while on VMS, I was never very good at it, and abanded it for a full-screen editor at he first

Re: What does “grep” stand for?

2015-11-05 Thread Random832
Chris Angelico writes: > As someone who grew up on MS-DOS, I'd like to mention that EDLIN's > value wasn't in the obvious places. There were two features it had > that most other editors didn't: firstly, it would read only as much of > the file as it needed, so you could edit a

Re: What does “grep” stand for?

2015-11-04 Thread Chris Angelico
On Thu, Nov 5, 2015 at 6:38 AM, Christian Gollwitzer wrote: > Am 04.11.15 um 19:24 schrieb Ben Finney: >> >> The name is a mnemonic for a compound command in ‘ed’ [0], a text editor >> that pre-dates extravagant luxuries like “presenting a full screen of >> text at one time”. >>

Re: What does “grep” stand for?

2015-11-04 Thread Christian Gollwitzer
Am 05.11.15 um 01:42 schrieb Chris Angelico: On Thu, Nov 5, 2015 at 6:38 AM, Christian Gollwitzer wrote: As someone who grew up on MS-DOS, I'd like to mention that EDLIN's value wasn't in the obvious places. There were two features it had that most other editors didn't:

Re: What does “grep” stand for? (was: Regular expressions)

2015-11-04 Thread Tim Chase
On 2015-11-05 05:24, Ben Finney wrote: > A very common command to issue, then, is “actually show me the line > of text I just specified”; the ‘p’ (for “print”) command. > > Another very common command is “find the text matching this pattern > and perform these commands on it”, which is ‘g’ (for

Re: What does “grep” stand for?

2015-11-04 Thread Christian Gollwitzer
Am 04.11.15 um 19:24 schrieb Ben Finney: The name is a mnemonic for a compound command in ‘ed’ [0], a text editor that pre-dates extravagant luxuries like “presenting a full screen of text at one time”. [... lots of fun facts ...] Here is another fun fact: The convincing UI of ed was

What does “grep” stand for? (was: Regular expressions)

2015-11-04 Thread Ben Finney
Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> writes: > On Wednesday 04 November 2015 13:55, Dan Sommers wrote: > > > Its very name indicates that its default mode most certainly is > > regular expressions. > > I don't even know what grep stands fo

[issue23216] IDLE grep/find/replace source code needs docstrings

2015-01-11 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +terry.reedy stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23216 ___

[issue23216] IDLE grep/find/replace source code needs docstrings

2015-01-10 Thread Al Sweigart
: normal severity: normal status: open title: IDLE grep/find/replace source code needs docstrings type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file37663/idle_docstrings.diff ___ Python tracker rep...@bugs.python.org http

[issue23216] IDLE grep/find/replace source code needs docstrings

2015-01-10 Thread Al Sweigart
Changes by Al Sweigart asweig...@gmail.com: -- versions: +Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23216 ___ ___

Using sh library with grep command

2013-11-23 Thread Luca
I'm trying to use sh (https://pypi.python.org/pypi/sh) for calling system grep command but it's now working as expected. An example: import sh sh.grep('abc', os.getcwd(), '-r') But I get the ErrorReturnCode_1: exception, that I learned is the normal exit code for grep command when

Re: Using sh library with grep command

2013-11-23 Thread Roy Smith
In article mailman.3088.1385218947.18130.python-l...@python.org, Luca luca...@gmail.com wrote: I'm trying to use sh (https://pypi.python.org/pypi/sh) for calling system grep command but it's now working as expected. An example: import sh sh.grep('abc', os.getcwd(), '-r

Re: Using sh library with grep command

2013-11-23 Thread Peter Otten
Luca wrote: I'm trying to use sh (https://pypi.python.org/pypi/sh) for calling system grep command but it's now working as expected. An example: import sh sh.grep('abc', os.getcwd(), '-r') But I get the ErrorReturnCode_1: exception, that I learned is the normal exit code

Re: Using sh library with grep command

2013-11-23 Thread Luca Fabbri
On Sat, Nov 23, 2013 at 5:29 PM, Peter Otten __pete...@web.de wrote: Luca wrote: I'm trying to use sh (https://pypi.python.org/pypi/sh) for calling system grep command but it's now working as expected. An example: import sh sh.grep('abc', os.getcwd(), '-r') But I get

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-11 Thread Alexander Gattin
Hello, On Thu, Feb 10, 2011 at 07:52:34AM +0100, Petter Gustad wrote: r...@rpw3.org (Rob Warnock) writes: invocation was given only one arg!! IT FOUND THE PATTERN, BUT DIDN'T TELL ME WHAT !@^%!$@#@! FILE IT WAS IN!! :-{ Sounds frustrating, but grep -H will always print the filename

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-11 Thread Alexander Gattin
Hello, On Tue, Feb 08, 2011 at 05:32:05PM +, Icarus Sparry wrote: The key thing which makes this 'modern' is the '+' at the end of the command, rather than '\;'. This causes find to execute the grep once per group of files, rather than once per file. many thanks to you, man! I'm

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-11 Thread Xah Lee
On Feb 11, 2:06 am, Alexander Gattin xr...@yandex.ru wrote: Hello, On Tue, Feb 08, 2011 at 05:32:05PM +, Icarus Sparry wrote: The key thing which makes this 'modern' is the '+' at the end of the command, rather than '\;'. This causes find to execute the grep once per group

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Harald Hanche-Olsen
[Icarus Sparry i.sparry...@gmail.com] The 'modern' way to do this is find . -maxdepth 2 -name '*.html' -exec grep whatever {} + Actually, I think it should be find . -maxdepth 2 -name '*.html' -exec grep whatever /dev/null {} + because grep behaves differently when given only one filename

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Harald Hanche-Olsen
[Icarus Sparry i.sparry...@gmail.com] The 'modern' way to do this is find . -maxdepth 2 -name '*.html' -exec grep whatever {} + Actually, I think it should be find . -maxdepth 2 -name '*.html' -exec grep whatever /dev/null {} + \; because grep behaves differently when given only one filename

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Tassilo Horn
Xah Lee xah...@gmail.com writes: You can rely on shell globbing, so that grep gets a list of all files in all subdirectories.  For example, I can grep all header files of the linux kernel using   % grep FOO /usr/src/linux/**/*.h say, i want to search in the dir ~/web/xahlee_org

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Rob Warnock
Harald Hanche-Olsen han...@math.ntnu.no wrote: +--- | [Icarus Sparry i.sparry...@gmail.com] | The 'modern' way to do this is | find . -maxdepth 2 -name '*.html' -exec grep whatever {} + | | Actually, I think it should be | find . -maxdepth 2 -name '*.html' -exec grep whatever

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Rob Warnock
Harald Hanche-Olsen han...@math.ntnu.no wrote: +--- | [Icarus Sparry i.sparry...@gmail.com] | The 'modern' way to do this is | find . -maxdepth 2 -name '*.html' -exec grep whatever {} + | | Actually, I think it should be | find . -maxdepth 2 -name '*.html' -exec grep whatever

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Thomas L. Shinnick
At 09:39 PM 2/9/2011, Rob Warnock wrote: Harald Hanche-Olsen han...@math.ntnu.no wrote: [snip] Years years ago, right after I learned about xargs, I got burned several times on find | xargs grep pat when the file list was long enough that xargs fired up more than one grep... and the last

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Petter Gustad
r...@rpw3.org (Rob Warnock) writes: invocation was given only one arg!! IT FOUND THE PATTERN, BUT DIDN'T TELL ME WHAT !@^%!$@#@! FILE IT WAS IN!! :-{ Sounds frustrating, but grep -H will always print the filename, even when given a single filename on the command line. //Petter -- .sig

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Petter Gustad
Xah Lee xah...@gmail.com writes: problem with find xargs is that they spawn grep for each file, which becomes too slow to be usable. find . -maxdepth 2 -name '*.html -print0 | xargs -0 grep whatever will call grep with a list of filenames given by find, only a single grep process will run

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Icarus Sparry
On Tue, 08 Feb 2011 13:51:54 +0100, Petter Gustad wrote: Xah Lee xah...@gmail.com writes: problem with find xargs is that they spawn grep for each file, which becomes too slow to be usable. find . -maxdepth 2 -name '*.html -print0 | xargs -0 grep whatever will call grep with a list

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Petter Gustad
Icarus Sparry i.sparry...@gmail.com writes: The 'modern' way to do this is find . -maxdepth 2 -name '*.html' -exec grep whatever {} + Agree, I've noticed that recent version of find have the + option. I remember in the old days the exec method was considered bad since it would fork grep

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Xah Lee
On Feb 8, 9:32 am, Icarus Sparry i.sparry...@gmail.com wrote: On Tue, 08 Feb 2011 13:51:54 +0100, Petter Gustad wrote: Xah Lee xah...@gmail.com writes: problem with find xargs is that they spawn grep for each file, which becomes too slow to be usable. find . -maxdepth 2 -name '*.html

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Icarus Sparry
On Tue, 08 Feb 2011 14:30:53 -0800, Xah Lee wrote: On Feb 8, 9:32 am, Icarus Sparry i.sparry...@gmail.com wrote: [snip] The 'modern' way to do this is find . -maxdepth 2 -name '*.html' -exec grep whatever {} + The key thing which makes this 'modern' is the '+' at the end of the command

[issue7716] IPv6 detection, don't assume existence of /usr/xpg4/bin/grep

2011-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thank you for the patch! It is committed in r87698 (3.2), r87699 (3.1) and r87700 (2.7). -- nosy: +pitrou resolution: - fixed stage: - committed/rejected status: open - closed versions: -Python 2.6

[issue7716] IPv6 detection, don't assume existence of /usr/xpg4/bin/grep

2011-01-01 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: Hi, I think the best way to test this patch is to apply the fix and then compile python on a Solaris system (which I don't have): is someone owning a Solaris would run this test? -- nosy: +sandro.tosi

[issue7716] IPv6 detection, don't assume existence of /usr/xpg4/bin/grep

2010-07-06 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: This is a miniscule patch to configure.in could someone please run with this. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7716

Re: How do subprocess.Popen(ls | grep foo, shell=True) with shell=False?

2010-06-12 Thread Nobody
On Thu, 10 Jun 2010 08:40:03 -0700, Chris Seberino wrote: On Jun 10, 6:52 am, Nobody nob...@nowhere.com wrote: Without the p1.stdout.close(), if the reader (grep) terminates before consuming all of its input, the writer (ls) won't terminate so long as Python retains the descriptor

Re: How do subprocess.Popen(ls | grep foo, shell=True) with shell=False?

2010-06-11 Thread Steven W. Orr
On 6/10/2010 11:40 AM, Chris Seberino wrote: Even if zombies are created, they will eventually get dealt with my OS w/o any user intervention needed right? Bad approach. Years ago I inherited a server that didn't do a proper cleanup pf its slaves. After a few days running, people discovered

grep command

2010-06-10 Thread madhuri vio
i was wondering bout the usage and syntax of grep command..can u tall me its syntax so that i can use it and proceed...pls -- madhuri :) -- http://mail.python.org/mailman/listinfo/python-list

Re: grep command

2010-06-10 Thread Simon Brunning
On 10 June 2010 07:38, madhuri vio madhuri@gmail.com wrote: i was wondering bout the usage and syntax of grep command..can u tall me its syntax so that i can use it and proceed...pls That's really not on topic for this list. -- Cheers, Simon B. -- http://mail.python.org/mailman

Re: How do subprocess.Popen(ls | grep foo, shell=True) with shell=False?

2010-06-10 Thread Nobody
On Wed, 09 Jun 2010 21:15:48 -0700, Chris Seberino wrote: How do subprocess.Popen(ls | grep foo, shell=True) with shell=False? The same way that the shell does it, e.g.: from subprocess import Popen, PIPE p1 = Popen(ls, stdout=PIPE) p2 = Popen([grep, foo], stdin=p1.stdout, stdout = PIPE

Re: grep command

2010-06-10 Thread D'Arcy J.M. Cain
On Thu, 10 Jun 2010 08:26:58 +0100 Simon Brunning si...@brunningonline.net wrote: On 10 June 2010 07:38, madhuri vio madhuri@gmail.com wrote: i was wondering bout the usage and syntax of grep command..can u tall me its syntax so that i can use it and proceed...pls That's really

Re: How do subprocess.Popen(ls | grep foo, shell=True) with shell=False?

2010-06-10 Thread Grant Edwards
On 2010-06-10, Chris Seberino cseber...@gmail.com wrote: How do subprocess.Popen(ls | grep foo, shell=True) with shell=False? You'll have to build your own pipeline with multiple calls to subprocess Does complex commands with | in them mandate shell=True? Yes. Hey, I've got a novel idea

Re: How do subprocess.Popen(ls | grep foo, shell=True) with shell=False?

2010-06-10 Thread Chris Seberino
On Jun 10, 6:52 am, Nobody nob...@nowhere.com wrote: Without the p1.stdout.close(), if the reader (grep) terminates before consuming all of its input, the writer (ls) won't terminate so long as Python retains the descriptor corresponding to p1.stdout. In this situation, the p1.wait

Re: How do subprocess.Popen(ls | grep foo, shell=True) with shell=False?

2010-06-10 Thread Lie Ryan
On 06/10/10 21:52, Nobody wrote: Spawning child processes to perform tasks which can easily be performed in Python is inefficient Not necessarily so, recently I wrote a script which takes a blink of an eye when I pipe through cat/grep to prefilter the lines before doing further complex

Re: How do subprocess.Popen(ls | grep foo, shell=True) with shell=False?

2010-06-10 Thread Dan Stromberg
On Thu, Jun 10, 2010 at 4:52 AM, Nobody nob...@nowhere.com wrote: Also, ls | grep may provide a useful tutorial for the subprocess module, but if you actually need to enumerate files, use e.g. os.listdir/os.walk() and re.search/fnmatch, or glob. Spawning child processes to perform tasks which

  1   2   3   >