I am on macOS.
Here is my source file:
#!/bin/bash
version=42
o_ver=$version
let "version+=1"
echo Compiling version $version up from $o_ver
. . . many more lines
I want to extract the version number (42 in this case) and use it to set the r_ver variable in the following bash script:
#!/bin/bash
r_ver= ??
I tried using grep but most examples use the -P flag not available on macOS.