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*

2
  • 2
    Please add your desired output (no description, no images, no links) for that sample input to your question (no comment). Commented Dec 22, 2021 at 18:34
  • Just to help you understand what your program is actually doing: Since you never define the variable ls, your script defines an empty environment variable named output, and then runs the first argument supplied to your script as a command. You could see the effect when executing $bash practice.sh printenv|grep output, which will show the empty definition for output. Commented Dec 23, 2021 at 8:59