the swap file for "somedir/foo.c" is "somedir/.foo.c.swp" -- not
"somedir/foo.c.swp" so i had to catch the "." after the path to exclude it.
there is probably a much better way of doing this, especially since i turn
around and pipe into a while. setting some auxillary variable in the loop
like j=`dirname $i`"/"`${i:1:${#i}-4} would be simpler and would keep access
to the original swp file name around so i wouldn't have to reconstruct it in
the rm at the end of the loop.

sed expressions are definitely not the prettiest, but god i love 'em :)

On Tue, Oct 6, 2009 at 10:46 PM, bill lam <[email protected]> wrote:

>
> On Tue, 06 Oct 2009, Chris Suter wrote:
> > sed 's/\(.*\/\)\.\([^.]\+\(\.[^.]\+\)\?\)\.swp/\1\2/' | \
>
> Just curious, why not
>  sed 's/\(.*\)\.swp$/\1/' | \
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
>
> >
>


-- 
Christopher Suter

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to