#!/bin/bash
current_day = "6"
sed_output=$(sed -E "s/\b${current_day}\b/$(tput setaf 1)&$(tput sgr0)/g" "calendar.txt")
if echo "$sed_output" | grep -q "$current_day"; then
echo "Value '$current_day' found in the modified output."
sed -i "s/$(tput setaf 1)$(printf '%s' $current_day)$(tput sgr0)/$current_day/g/" calendar.txt
#echo "Modifier removed."
else
echo "Value '$current_day' not found in the modified output."
fi
I keep getting an error message: "sed: -e expression #1, char 19: unterminated `s' command" The code should be removing the modifier and make the value unmodified.