betty
betty

Reputation: 25

what /bin/sed '/^$/d'| /bin/sed -e 's/^[ \t]*//' mean?

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

Answers (1)

Jotne
Jotne

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

Related Questions