Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 1
    How can we run a command stored in a variable? What are curly quotes and can I use them in my code? Commented Jan 18, 2023 at 20:59
  • @KamilMaciorowski Would you care to explain? I am able to run the command stored in a variable from first function. Only when I call it from a function within a function it fails. How is quotes/braces significant here? Commented Jan 18, 2023 at 21:22
  • 1
    @roaima sorry, that was a typo in question. I am using straight quotes in the actual code. Corrected it in question now. Commented Jan 18, 2023 at 21:58
  • "I am able to run the command stored in a variable from first function" - it's an unreliable way of running a command. Use functions for commands and variables for data Commented Jan 18, 2023 at 22:03
  • @roaima I Agree, but unfortunately I cannot change the method. This variable in question is set in a master script that’s read only and we just source them in other scripts. Even if I were to use a function here in my script, I will have to use this variable, and that again yields the same result. Commented Jan 18, 2023 at 22:41