emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] ob-shell-test, test-ob-shell and introduction
Date: Fri, 7 Jan 2022 23:18:24 +0700	[thread overview]
Message-ID: <sr9p4n$mkf$1@ciao.gmane.io> (raw)
In-Reply-To: <17e2d800e0e.cfffb732642942.2036522928042669584@excalamus.com>

On 06/01/2022 10:47, Matt wrote:
> 
>   > - In your examples variable values are simple. Often it is safer to add
>   > double quotes around variable or command expansion. I would consider
>   > adding quotes just to encourage people to do the same by default with
> 
> I appreciate these clarifications. Admittedly, I'm not great with
> shell scripting.  Your recommendations appear sound to me and I've tried
> to incorporate them.

I think, to illustrate unset variable escaped quotes were appropriate. 
Sorry that I was not clear enough.

    echo "X was set to \"$X\""

One more case where it is better (at least from my point of view) to add 
quotes even though they are not strictly necessary since command output 
contains single word and multiple words are interpreted by echo in the 
same way:

    echo "$(cut -f 1 -d "/") rocks!"

> The updates have been made and are pushed. Thanks for your feedback!

Thank you, text is more clear now. However first time I read it with 
more attention.

I forgot to suggest you the following tool that catches more problems 
than execution the script with "-n" option:

echo 'a=2; echo "$(($a * 2))"' | shellcheck -s sh -

In - line 1:
a=2; echo "$(($a * 2))"
               ^-- SC2004: $/${} is unnecessary on arithmetic variables.

For more information:
   https://www.shellcheck.net/wiki/SC2004 -- $/${} is unnecessary on 
arithmeti...



  reply	other threads:[~2022-01-07 16:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 18:37 [PATCH] ob-shell-test, test-ob-shell and introduction Matt
2021-11-22 18:43 ` Timothy
2021-11-24 18:48   ` Matt
2021-12-02  9:39     ` Timothy
2021-12-06  3:50       ` Matt
2021-12-06  4:50         ` Thomas S. Dye
2021-12-18  7:03           ` Matt
2021-12-18 20:51             ` Thomas S. Dye
2021-12-31 17:04             ` Thomas S. Dye
2021-12-31 19:18               ` Matt
2021-12-31 22:11                 ` Thomas S. Dye
2022-01-02  4:32                   ` Matt
2022-01-02 18:57                     ` Thomas S. Dye
2022-01-05 17:12                 ` Max Nikulin
2022-01-06  3:47                   ` Matt
2022-01-07 16:18                     ` Max Nikulin [this message]
2021-11-22 19:08 ` Thomas S. Dye
2021-11-23  4:42   ` [PATCH] ob-doc-shell.org (was [PATCH] ob-shell-test, test-ob-shell and introduction) Matt
2021-11-23  4:59     ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='sr9p4n$mkf$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).