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
  • 4
    What is the name of the first script? Commented May 21, 2020 at 0:18
  • 2
    How do you run the two scripts ? Writing ./scriptname on the cli? Then: what are the actual names (and paths) of each scriptname ? Commented May 21, 2020 at 0:23
  • 1
    ... as to why it's 2 rather than 1, it's likely because the shell forks for the command substitution - see for example Command substitution. Spawned process name is identical to the parent one Commented May 21, 2020 at 12:43
  • 1
    You're using bash syntax (the [[ ... =~ ... ]]) but trying to declare it as a sh script. Don't do that. Change the first line to #!/bin/bash and don't run it with sh. Commented May 21, 2020 at 22:43