Reputation: 25
Please explain the two 'sed' command in the following line:
/bin/cat $TMPFILE | /bin/sed '/^$/d'| /bin/sed -e 's/^[ \t]*//' > $RPTFILE
Thanks in advance, Betty
Upvotes: 2
Views: 2526
Reputation: 41460
sed '/^$/d'
Delete empty lines
sed -e 's/^[ \t]*//'
remove leading spaces and tabs.
^
start of line $
end of line, so ^$
line with just start and end, no data.
[ \t]*
group of space or tab (\t
). *
repeat zero or more times.
Upvotes: 3