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*

6
  • 1
    I'm not having any problems with this command. I get the contents of the file "test.txt", as expected. Commented Mar 12, 2018 at 21:43
  • 1
    I don't. echo foo > test.txt; f=test.txt cat $f waits for input from stdin rather showing foo. Commented Mar 12, 2018 at 21:46
  • @PhilipKendall; That's exactly what happening with me. Commented Mar 12, 2018 at 21:47
  • Why it is dupe? I am not asking what is someVariable=someValue command . Commented Mar 12, 2018 at 22:08
  • I misunderstood which statement you were asking about. Your second command won't work because the assignment is applied after the statement is executed, not before. See my solution for a more detailed explanation. Commented Mar 12, 2018 at 22:32