diff --git a/SC2001.md b/SC2001.md index a9bfd84..4c0df3c 100644 --- a/SC2001.md +++ b/SC2001.md @@ -15,6 +15,7 @@ Let's assume somewhere earlier in your code you have put data into a variable (E ### Contraindications Occasionally a more complex sed substitution is required. For example, getting the last character of a string. + string="stirng" ; echo "$string" | sed -e "s/^.*\(.\)$/\1/" This is a bit simple for the example and there are alternative ways of doing this in the shell, but this SC2001 flags on several of my crazy complex sed commands which are beyond the scope of this example. Utilizing some of the more complex capabilities of sed is required occasionally and it is safe to ignore SC2001.