Skip to content

wp.jochen.hayek.name/blog-en

    • About

best practices in shell script programming

Written by

johayek

in

The Shell Programming Language

You do know the result of this:

a=A; echo $a

But are you just as sure here?

a=A; b=B; echo $a.$b

That depends on the shell, you are using. So I suggest you better write it this way:

a=A; b=B; echo ${a}.${b}

Enclosing variable names in curly braces is quite often a good idea.

Share this:

  • Email a link to a friend (Opens in new window) Email
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Press This! (Opens in new window) Press This
  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on LinkedIn (Opens in new window) LinkedIn
  • More
  • Print (Opens in new window) Print
  • Share on Telegram (Opens in new window) Telegram
  • Share on Reddit (Opens in new window) Reddit
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest

Like this:

Like Loading…
←Task::Kensho – “A Glimpse at an Enlightened Perl”
best practices in shell script programming – double quotes→

Comments

Leave a Reply Cancel reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

More posts

  • setting up VPN with my routers at home

    2026-09-23
  • BVG musicians – the community …

    2026-09-17
  • OmniSSH instead of PuTTY?

    2026-09-14
  • my Apple Watch and my router

    2026-09-10

wp.jochen.hayek.name/blog-en

Just another Jochen Hayek site

  • Blog
  • About
  • FAQs
  • Authors
  • Events
  • Shop
  • Patterns
  • Themes

Twenty Twenty-Five

Designed with WordPress

%d