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
  • 3
    If you're going to "perform calculations" then it's probably best to do that within awk - rather than extracting them back to the shell and doing so there Commented Mar 15, 2018 at 22:53
  • I understand that but the requirements of the assignments are to have two shell scripts interacting with each other (which I've figured out) but I need to use awk or some other utility to extract the numbers. Commented Mar 15, 2018 at 23:26
  • 1
    The shell is a beautifully functional utility orchestrator. It is a horribly inefficient programming language. Use it for what it's good for—calling other utilities and making them work together. Don't try and do any actual work with Bash itself. (In other words: listen to @steeldriver and do your calculations in awk or, if you're feeling rebellious, in bc.) Commented Mar 16, 2018 at 0:01
  • What do you want these calculations to do? It may be better to exclude awk and bash altogether and use an actual programming language such as python for your needs. Commented Mar 16, 2018 at 1:35