hashrate=${line//*:/}
hashrate=${hashrate//H\/s/}
I'm trying to unify this regex replace into a single command, something like:
hashrate=${line//*:\+/H\/s/}
However, this last option doesn't work. I also tried with \|
, but it doesn't seem to work and I haven't found anything useful in bash manuals and documentation. I need to use ${}
instead of sed, even if using it solves my problem.