thanks bakunin,
the explanation was perfect.
but i am afraid it didnt work.
I have this inside a loop and I cant make it work
Because I belive the sed is appending write under the
string: alias 24x7-comunicacions
Or is it because >> dosent work well, or both?
THe result is only the first LINEX
echo "$LINESB" | while read line; do
#COUNTS THE LINES, FIRST LINE IS BAD! THEN ADD "members $HOSTNAME, each line TO maps.txt"
: $((LCOUNT = $LCOUNT + 1))
if [ $LCOUNT -gt 1 ]; then
#echo $LCOUNT
LINEX=" members $HOSTNAME,$line"
echo "$LINEX"
sed '/alias 24x7-comunicacions/a\'"$LINEX" "$FILECFG" >>temp.txt
fi
done