~strahinja/dotfiles

183952d86e838d2392af864eadc53d494f232d95 — Страхиња Радић 3 months ago 8128388
Replaced sed calls with ufold

Signed-off-by: Страхиња Радић <contact@strahinja.org>
1 files changed, 3 insertions(+), 2 deletions(-)

M bin/pagecheck
M bin/pagecheck => bin/pagecheck +3 -2
@@ 55,8 55,9 @@ curl -s $URL | grep $REGEXP | sed -e's/<p>/\\n\\n/g' | sed -ze's/\n/\\n/g' | \
if [ $(( $(wc -c $TMPFILE | cut -d' ' -f1) )) -gt 0 ]; then
	if ! grep -F -f $TMPFILE $CACHEFILE &>/dev/null; then
		echo "\\nURL: $URL\\n" >> $TMPFILE
		cat $TMPFILE | sed -e's/\\n/\n/g' | \
			sed "s/.\\{$WRAPWIDTH\\}/&\\n/g" > $NEWFILE
		ufold -w $WRAPWIDTH $TMPFILE > $NEWFILE
		#cat $TMPFILE | sed -e's/\\n/\n/g' | \
		#	sed "s/.\\{$WRAPWIDTH\\}/&\\n/g" > $NEWFILE
		print_new | neomutt -s "[$PROG] New update" $EMAIL
		BODY=$(print_new)
		notify-send -i $ICON "$TITLE" "$BODY"