The title says all. i need to replace a property value whom i don’t know to a different value.
i’m trying this:
#!/bin/bash
sed -i "s/myprop=[^ ]*/myprop=$newvalue/g" file.properties
i get sed: -e expression #1, char 19: unknown option tos’`
I think the problem is that $newvalue is a string that represents a directory so it messes up sed.
What can I do ?
sedcan use characters other than/as the delimiter, even though/is the most common. When dealing with things like pathnames, it’s often helpful to use something like pipe (|) instead.