Removing empty lines with grep as well as [, ], ', and ,?

Viewed 18
sed "s/[][,']//g"

I used this, but then I have empty lines getting returned. I know that you can use:

sed '/^[[:space:]]*$/d'

Delete empty lines using sed

However, trying sed "s/[][[:space:]][,']//g" didn't work as well as other stuff I have tried.

1 Answers

sed is a scripting language; combine the two commands to get the effect you seek.

sed "s/[][,']//g;"'/^[[:space:]]*$/d'
Related