Scripting / one liner help

Hal Burgiss hal at
Wed Aug 10 21:46:13 UTC 2011

On Wed, Aug 10, 2011 at 2:42 PM, Patton Echols <p.echols at> wrote:

> On 08/10/2011 09:47 AM, Hal Burgiss wrote:
>> See if this gets close to extracting the image names ...
>> grep SRC *html | sed -r 's/SRC="([^"]+)"/\1/ig' |
> Thanks Hal,
> my script starts with "for i in *jpg" and then works each file
> individually.  So I tried that line without the pipe to,
> hoping for a list of files to be output to the terminal.  That seemed to
> output the string of tags but without the double quotes around the image
> names.  Is that what it should have done?
That was what I was getting at, yes, the list of image filenames.

If you want just file names, you might try:

 grep -H SRC *hmtl | sed 's/:.*//' |sort|uniq

or something along those lines. (Completely untested)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ubuntu-users mailing list