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*

4
  • So in order to get my correct exit codes I would need to pass the argument I'm typing into script2 into script1 then my $? results would match my exit codes in script1? Commented Oct 10, 2020 at 17:11
  • @dylanw, yes, command line arguments don't get automatically "inherited" to other scripts, commands or functions Commented Oct 10, 2020 at 17:15
  • @ikkachu, now I should be able to just write something like if [ {$result} = 0 ] then echo "found filename" fi to set the exit codes = to whatever text I want? Commented Oct 10, 2020 at 17:34
  • @dylanw, yeah, res=$?; if [ "$res" = 0 ]; then echo 'return value was zero'; fi Commented Oct 10, 2020 at 18:22