Re: [dev] Shell style guide

2016-09-08 Thread Anselm R Garbe
Hi there, On 6 September 2016 at 20:35, Evan Gates wrote: > suckless.org projects have traditionally been small amounts of pure C. > The code tends towards simplicity and correctness. I value this and > have learned much over the past years from reading and contributing to > various projects. > >

Re: [dev] [st] bitmap font and chscale 1< line drawing bug

2016-09-08 Thread Eric Pruitt
On Wed, Sep 07, 2016 at 11:36:47PM -0700, le...@bitmessage.ch wrote: > On Wed, Sep 07, 2016 at 09:39:08PM -0700, Eric Pruitt wrote: > > Even if you don't debug and / or fix the problem, at least post the > > offending commit, and I will take a look. > > I was able to fix it the problem by rolling b

Re: [dev] Shell style guide

2016-09-08 Thread hiro
You're wrong kamil. my computer has a working border patrol that ensures your crappy files don't end up here. I never have to deal with such shitty file names. On 9/8/16, Kamil Cholewiński wrote: > On Thu, 08 Sep 2016, Nick wrote: >> I am against writing scripts that can deal with filenames with

Re: [dev] Shell style guide

2016-09-08 Thread Kamil Cholewiński
On Thu, 08 Sep 2016, Nick wrote: > I am against writing scripts that can deal with filenames with > newlines. Fuck such filenames. If you have to deal with them, shell > scripting is a terrible technology to use. And since you never know when you'll have to deal with them...

Re: [dev] Shell style guide

2016-09-08 Thread Evan Gates
On Thu, Sep 8, 2016 at 7:30 AM, Nick wrote: > I am against writing scripts that can deal with filenames with > newlines. Fuck such filenames. If you have to deal with them, shell > scripting is a terrible technology to use. I too think newlines in filenames is stupid. I never put newlines in my f

Re: [dev] Shell style guide

2016-09-08 Thread Evan Gates
On Thu, Sep 8, 2016 at 7:26 AM, Greg Reagle wrote: > On Thu, Sep 8, 2016, at 10:11 AM, Greg Reagle wrote: >> On Thu, Sep 8, 2016, at 10:05 AM, Kamil Cholewiński wrote: >> > Wow, shell quoting is just fucked up crazy. I was mostly using unquoted >> > $@ my whole life. And here I thought I knew enou

Re: [dev] Shell style guide

2016-09-08 Thread Nick
Quoth Evan Gates: > On Thu, Sep 8, 2016 at 5:44 AM, Nick wrote: > > I think this is something one learns with time. There are several > > good reasons not to quote substitutions, such as passing multiple > > arguments to another program (e.g. cmd $@), or a for or case > > statement. But yes, quoti

Re: [dev] Shell style guide

2016-09-08 Thread Greg Reagle
On Thu, Sep 8, 2016, at 10:11 AM, Greg Reagle wrote: > On Thu, Sep 8, 2016, at 10:05 AM, Kamil Cholewiński wrote: > > Wow, shell quoting is just fucked up crazy. I was mostly using unquoted > > $@ my whole life. And here I thought I knew enough not to screw up a > > simple script, > > It is common

Re: [dev] Shell style guide

2016-09-08 Thread Greg Reagle
On Thu, Sep 8, 2016, at 10:05 AM, Kamil Cholewiński wrote: > Wow, shell quoting is just fucked up crazy. I was mostly using unquoted > $@ my whole life. And here I thought I knew enough not to screw up a > simple script, It is common knowledge to always double-quote $@, i.e. "$@", in Bourne/Posix

Re: [dev]

2016-09-08 Thread Martin Kühne
Please disregard. My email skills failed me. cheers! mar77i

[dev]

2016-09-08 Thread Martin Kühne
Bash really is a special little snowflake. The space trimming feature, as I recently discovered is made available for all but the implicit REPLY. $ read -r <<<" TEST "; printf '<%s>\n' "$REPLY" < TEST > $ read -r REPLY <<<" TEST "; printf '<%s>\n' "$REPLY" As a heavy user of bash and

Re: [dev] Shell style guide

2016-09-08 Thread Martin Kühne
On Thu, Sep 8, 2016 at 4:11 PM, Greg Reagle wrote: > On Thu, Sep 8, 2016, at 10:05 AM, Kamil Cholewiński wrote: >> Wow, shell quoting is just fucked up crazy. I was mostly using unquoted >> $@ my whole life. And here I thought I knew enough not to screw up a >> simple script, > > It is common know

Re: [dev] Shell style guide

2016-09-08 Thread Kamil Cholewiński
On Thu, 08 Sep 2016, Evan Gates wrote: > No. $@ is another example of something that _must_ be quoted every > time. When inside quotes the shell expands it correctly to a word for > each parameter. Without quotes the shell will do extra word splitting > and globbing. For example, try this: > > nar

Re: [dev] Shell style guide

2016-09-08 Thread Evan Gates
On Wed, Sep 7, 2016 at 11:21 PM, Martin Kühne wrote: > As with read's -r flag, use <<'EOF' unless silly/potentially > devastating side effects are desired. To add on to this, if reading lines, use IFS= as well so you don't lose leading/trailing whitespace. e.g.: while IFS= read -r line; do s

Re: [dev] Shell style guide

2016-09-08 Thread Evan Gates
On Thu, Sep 8, 2016 at 12:27 AM, wrote: > is there a special reason people use `EOF` rather than anything else. > FWIW, I use a dot. looks very clear and natural to me, saves some > keystrokes, feels right, just as ending a sentence with full stop. > > cat <<. > 1st line > 2nd line > 3rd line > 4

Re: [dev] Shell style guide

2016-09-08 Thread Evan Gates
On Thu, Sep 8, 2016 at 5:44 AM, Nick wrote: > I think this is something one learns with time. There are several > good reasons not to quote substitutions, such as passing multiple > arguments to another program (e.g. cmd $@), or a for or case > statement. But yes, quoting is essential most of the

Re: [dev] Shell style guide

2016-09-08 Thread Nick
Hi Evan, I agree with most of your thoughts, I'll just add my own where they differ. > Shebang: Use #!/bin/sh and only use POSIX shell features. If you need > bash features use the proper shebang, either #!/path/to/bash or > #!/usr/bin/env bash No suckless project should be using bash. If you ne

Re: [dev] Shell style guide

2016-09-08 Thread ssd
* Marc Collin 2016-09-08 05:04 > What people here think of heredoc? > > cat << EOF > 1st line > 2nd line > 3rd line > 4th line > EOF is there a special reason people use `EOF` rather than anything else. FWIW, I use a dot. looks very clear and natural to me, saves some keystrokes, feels right, ju