The following line removes the leading text before the variable $PRECEDING
temp2=${content#$PRECEDING}
But now i want the $PRECEDING to be case-insensitive. This works with sed‘s I flag. But i can’t figure out the whole cmd.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a way to do it with sed:
Explanation:
^.*$PRECEDING:^means start of string,.means any character,.*means any character zero or more times. So together this means “match any pattern from start of string that is followed by (and including) string stored in$PRECEDING.Ipart means case-insensitive, thegpart (if you use it) means “match all occurrences” instead of just the 1st.<<<notation is for herestrings, so you save anecho.