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
  • Please show how exactly you call your function, what happens and what you want to happen. Maybe you can replace the default value with something like if [ check_that_your_variables_are_defined ] ; then eval your_variables ; else loop fsayd ; fi Commented Aug 9, 2019 at 16:04
  • @Bodo As the comment says, loop fsayd is a very simple command that can be substituted by echo hi if you want to test it yourself. The problem is that it needs to be substituted as "loop" "fsayd" but it is substituted as "loop fsayd" which causes a command not found error. Commented Aug 9, 2019 at 16:36
  • Repeating the information from the question doesn't help. I suggest to edit your question to add more information. You should explain your variable substitution and what would be the case when the script will not use the default value (echo hi). For echo hi a double eval eval ${...} works, but I don't know what would be the other case. Commented Aug 9, 2019 at 16:54
  • @bodo Better now? Commented Aug 9, 2019 at 17:36
  • 1
    there are of course alternatives to using default values to solve this particular case but I guess those are outside the scope. Commented Aug 9, 2019 at 17:47