Skip to main content
deleted 5 characters in body
Source Link
user000001
  • 3.8k
  • 22
  • 33

If you are invoking sed/awk from a bash script/terminal, then you could avoid using the external tools and take advantage of bash's own string processing capabilities:

$ a='schedule="0.25"'
$ echo "$a"
schedule="0.25"
$ b="${a/\"[^\"]*\"*/\"0.50\"}"
$ echo "$b"
schedule="0.50"

If you are invoking sed/awk from a bash script/terminal, then you could avoid using the external tools and take advantage of bash's own string processing capabilities:

$ a='schedule="0.25"'
$ echo "$a"
schedule="0.25"
$ b="${a/\"[^\"]*/\"0.50\"}"
$ echo "$b"
schedule="0.50"

If you are invoking sed/awk from a bash script/terminal, then you could avoid using the external tools and take advantage of bash's own string processing capabilities:

$ a='schedule="0.25"'
$ echo "$a"
schedule="0.25"
$ b="${a/\"*/\"0.50\"}"
$ echo "$b"
schedule="0.50"
Source Link
user000001
  • 3.8k
  • 22
  • 33

If you are invoking sed/awk from a bash script/terminal, then you could avoid using the external tools and take advantage of bash's own string processing capabilities:

$ a='schedule="0.25"'
$ echo "$a"
schedule="0.25"
$ b="${a/\"[^\"]*/\"0.50\"}"
$ echo "$b"
schedule="0.50"