fogbound.net




Mon, 21 Aug 2023

Another “sed” one-liner

— SjG @ 1:22 pm

I needed to generate a comma-delimited, quoted list of all the .svg image files in a directory, but without the extension.

This worked:

ls -1 ./svgs | sed 's/.*/"&"/' | sed 's/\.svg//' | paste -sd, -

Hooray for the command-line!

(coming soon, why I needed that list…)

Filed in:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.