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*

5
  • Edit question to show first line of script (#!…), and to show how you call find_user. Commented Jun 24, 2020 at 21:46
  • @ctrl-alt-delor Is that acceptable? It's part of a much larger script. I am calling the script as a test by copying and pasting the function into a bash shell, and typing find_user to start it Commented Jun 24, 2020 at 21:57
  • That is not a good question title because you do not run the same code in an interactive shell and in a script. If you had replaced $a with jsmith in the script, then the script would have worked, too. Commented Jun 24, 2020 at 22:10
  • @HaukeLaging Suggestion on what I could say for the title? Commented Jun 24, 2020 at 22:19
  • Perhaps something like array access does not work as expected Commented Jun 24, 2020 at 22:23