Re: [GTALUG] Hardcore sed foo

2019-11-12 Thread Lennart Sorensen via talk
On Sat, Nov 09, 2019 at 01:55:24PM -0500, Alvin Starr via talk wrote: > It was hard to write. It should be hard to understand. "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to d

Re: [GTALUG] Hardcore sed foo

2019-11-09 Thread Alvin Starr via talk
On 11/9/19 9:34 AM, Anthony de Boer via talk wrote: Dave Collier-Brown via talk wrote: On 2019-11-08 11:41 a.m., Giles Orr via talk wrote: Eyeballing simple regex is hard enough, but mentally parsing out a complex full line regex that looks like inline garbage without the benefit of comments is

Re: [GTALUG] Hardcore sed foo

2019-11-09 Thread Anthony de Boer via talk
Dave Collier-Brown via talk wrote: > On 2019-11-08 11:41 a.m., Giles Orr via talk wrote: > > Eyeballing simple regex is hard enough, but mentally parsing out a > > complex full line regex that looks like inline garbage without the > > benefit of comments isn't something I recommend or appreciate. >

Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Dave Collier-Brown via talk
On 2019-11-08 3:13 p.m., Lennart Sorensen wrote: > On Fri, Nov 08, 2019 at 07:27:47PM +, Dave Collier-Brown via talk wrote: >> On 2019-11-08 11:41 a.m., Giles Orr via talk wrote: >> >>> Eyeballing simple regex is hard enough, but mentally parsing out a >>> complex full line regex that looks li

Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Scott Allen via talk
> On Fri, Nov 08, 2019 at 07:27:47PM +, Dave Collier-Brown via talk wrote: > > On 2019-11-08 11:41 a.m., Giles Orr via talk wrote: > > An early boss described it as "programming in line noise". > > I thought that was perl. Or maybe APL. -- Scott --- Post to this mailing list talk@gtalug.org

Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Lennart Sorensen via talk
On Fri, Nov 08, 2019 at 07:27:47PM +, Dave Collier-Brown via talk wrote: > On 2019-11-08 11:41 a.m., Giles Orr via talk wrote: > > > Eyeballing simple regex is hard enough, but mentally parsing out a > > complex full line regex that looks like inline garbage without the > > benefit of comments

Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Dave Collier-Brown via talk
On 2019-11-08 11:41 a.m., Giles Orr via talk wrote: > Eyeballing simple regex is hard enough, but mentally parsing out a > complex full line regex that looks like inline garbage without the > benefit of comments isn't something I recommend or appreciate. An early boss described it as "programming

Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Giles Orr via talk
On Thu, 7 Nov 2019 at 23:26, Anthony de Boer via talk wrote: > Lennart Sorensen via talk wrote: > > On Tue, Nov 05, 2019 at 06:42:44AM -0500, Giles Orr via talk wrote: > > > ... > > > Jeez regex is a pain - it took three minutes of staring at that just to > > > figure it out, even though I knew

Re: [GTALUG] Hardcore sed foo

2019-11-07 Thread Anthony de Boer via talk
Lennart Sorensen via talk wrote: > On Tue, Nov 05, 2019 at 06:42:44AM -0500, Giles Orr via talk wrote: > > ... > > Jeez regex is a pain - it took three minutes of staring at that just to > > figure it out, even though I knew what we were both trying to achieve. > > Practice time! > > https://reg

Re: [GTALUG] Hardcore sed foo

2019-11-07 Thread Lennart Sorensen via talk
On Tue, Nov 05, 2019 at 06:42:44AM -0500, Giles Orr via talk wrote: > On Tue, 5 Nov 2019 at 01:47, William Park via talk wrote: > > > 0 or 1 match is ? > > Eg. echo /aaa/.bbb//ccc/123 | sed 's,\(/\.\?[^/]\)[^/]*,\1,g' > > --William > > > > Nice - that works too. > > Jeez regex is a pain - it t

Re: [GTALUG] Hardcore sed foo

2019-11-05 Thread Giles Orr via talk
On Tue, 5 Nov 2019 at 06:42, Giles Orr wrote: > On Tue, 5 Nov 2019 at 01:47, William Park via talk > wrote: > >> 0 or 1 match is ? >> Eg. echo /aaa/.bbb//ccc/123 | sed 's,\(/\.\?[^/]\)[^/]*,\1,g' >> --William >> > > Nice - that works too. > > Jeez regex is a pain - it took three minutes of star

Re: [GTALUG] Hardcore sed foo

2019-11-05 Thread Giles Orr via talk
On Tue, 5 Nov 2019 at 01:47, William Park via talk wrote: > 0 or 1 match is ? > Eg. echo /aaa/.bbb//ccc/123 | sed 's,\(/\.\?[^/]\)[^/]*,\1,g' > --William > Nice - that works too. Jeez regex is a pain - it took three minutes of staring at that just to figure it out, even though I knew what we w

Re: [GTALUG] Hardcore sed foo

2019-11-04 Thread William Park via talk
0 or 1 match is ?Eg.  echo /aaa/.bbb//ccc/123 | sed 's,\(/\.\?[^/]\)[^/]*,\1,g'--William Sent from Yahoo Mail on Android On Mon, Nov 4, 2019 at 8:24 PM, Giles Orr via talk wrote: --- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/lis

Re: [GTALUG] Hardcore sed foo

2019-11-04 Thread Giles Orr via talk
On Mon, 4 Nov 2019 at 18:36, William Witteman wrote: > No sed knowledge here, but what if you turn it around, and grab two > characters and conditionally truncate, rather than the other way around? > > My only useful programming advice is when you get stuck, turn your problem > around. > > On Mon

Re: [GTALUG] Hardcore sed foo

2019-11-04 Thread William Witteman via talk
No sed knowledge here, but what if you turn it around, and grab two characters and conditionally truncate, rather than the other way around? My only useful programming advice is when you get stuck, turn your problem around. On Mon., Nov. 4, 2019, 18:31 Giles Orr via talk, wrote: > I've tinkered

[GTALUG] Hardcore sed foo

2019-11-04 Thread Giles Orr via talk
I've tinkered with Bash prompts for a lot of years. That's where this problem originates, but it can be considered just as a thought experiment if you prefer. We have the directory we're in, for example: /Users/gorr/.bashprompt/really/deep/directory/structure/even/deeper (I keep my prompts