Monday, 29 June 2020

Shell script - remove first and last quote (") from a variable

Use tr to delete ":
 echo "$opt" | tr -d '"'

from : https://stackoverflow.com/questions/9733338/shell-script-remove-first-and-last-quote-from-a-variable

No comments:

Post a Comment

How to check if a file contains a specific string using Bash

 In case if you want to check whether file does not contain a specific string, you can do it as follows. if ! grep -q SomeString "$File...