Re: [dev] Shell style guide

From: Adrian Grigore <adrian.emil.grigore_AT_gmail.com>
Date: Thu, 8 Sep 2016 00:33:15 +0300

Thanks!

On Thu, Sep 8, 2016 at 12:29 AM, Evan Gates <evan.gates_AT_gmail.com> wrote:
> On Wed, Sep 7, 2016 at 2:11 PM, Adrian Grigore
> <adrian.emil.grigore_AT_gmail.com> wrote:
>> Rendering was just an example, I doubt a shell script would be rendering.
>>
>> Example of camelCase I find ok is here:
>> https://raw.githubusercontent.com/adriangrigore/bootstrap/master/bootstrap
>>
>> Be free to critique the script, but note that I'm new to the whole
>> UNIX/C scene so learning as I go (if I did some blatant mistakes,
>> please point them).
>>
>
> In this line:
>
>>&2 echo usage: bootstrap name [description] [license]
>
> You must quote. [description] is a glob, if you have a file named e in
> the directory it will print: usage: bootstrap name e e
>
> This line:
>
> if [ $(license -list | tail -n +3 | awk '{ print $1 }' | grep "$type") ]; then
>
> No need for [] nor $(), just use if license -list | ... | grep -q
> "$type"; then
> Also you should rarely, if ever, need both awk and grep in a single
> pipeline (you can get rid of tail too and just license | awk)
>



-- 
Thanks,
Adi
Received on Wed Sep 07 2016 - 23:33:15 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 07 2016 - 23:36:19 CEST