programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
zephyr@lemmy.world to Programming · 2 years ago

How do you shell expand your variables and why?

lemmy.world

message-square
29
link
fedilink
  • cross-posted to:
  • shell
64

How do you shell expand your variables and why?

lemmy.world

zephyr@lemmy.world to Programming · 2 years ago
message-square
29
link
fedilink
  • cross-posted to:
  • shell
  • bloopernova
    link
    fedilink
    English
    arrow-up
    13
    ·
    edit-2
    2 years ago

    This is the best way. It’s also the way the Shellcheck wants sometimes recommends.

    • thingsiplay@kbin.social
      link
      fedilink
      arrow-up
      8
      ·
      2 years ago

      @bloopernova As you mention it, here the links for anyone interested: Online tool https://www.shellcheck.net/ and you can install it locally too https://github.com/koalaman/shellcheck .

      • hascat
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 years ago

        While this looks like a handy tool, it does make me think shell scripting itself needs a cleaner approach than what we have currently.

        • thingsiplay@kbin.social
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          deleted by creator

    • Gamma
      link
      fedilink
      English
      arrow-up
      6
      ·
      2 years ago

      This isn’t true. Shellcheck doesn’t insist on braces unless it thinks you need them.

      • bloopernova
        link
        fedilink
        English
        arrow-up
        4
        arrow-down
        1
        ·
        2 years ago

        Oh! I didn’t know that (um, obviously lol)

        I’ll edit my comment.

Programming

programming

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 275 users / day
  • 954 users / week
  • 3.39K users / month
  • 7.93K users / 6 months
  • 2.94K local subscribers
  • 24.7K subscribers
  • 2.82K Posts
  • 43.3K Comments
  • Modlog
  • mods:
  • snowe
  • Ategon
  • MaungaHikoi@lemmy.nz
  • UlrikHD
  • BE: 0.19.13
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org