Question: I'm interesting in printing the names (less extension) of a few CSV files as a list in YAML in my bash script. The code below prints out the filenames, but I want to prefix with a dash / space ( i.e. "- " ) so YAML will recognize it as a list. Any tips?

```
ls -1 csv | sed -e 's/\..*$//' > filenames.yaml

```

Thanks!

Answer: 
Instead of just removing the file extension (aka replace suffix with nothing), match the whole filename and prepend the list identifiers via a backreference.

```
ls *.csv | sed -e 's/^\(.*\)\..*$/- \1/' > filenames.yaml

```
Doesn't this work?

```
ls *.csv | sed -e 's/\.csv$//'  >filenames.yaml

```