sed command separated in some steps