Modified tab completion function to use sed instead of grep+cut