sed + path substitution
By default, I am using “/” character in sed substitution scripts. However this may lead to issues with UNIX path substitution.
sed is capable of using any other character within scripts. Instead of using
sed 's/\/sUNIX\/path/\/new\/path/g'
you can use
sed 's|/UNIX/path|/new/path|g'
or you can even use environment variables (remember to replace ‘ with “)
sed "s|$PREVIOUS_PATH|$NEW_PATH|g"
June 10th, 2010 in
main entries