parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {/} as basename


From: Hans Schou
Subject: Re: {/} as basename
Date: Wed, 27 Oct 2010 19:06:53 +0200 (CEST)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

On Wed, 27 Oct 2010, Ole Tange wrote:

{.} is a shorthand for removing from the last . in the filename (and
thereby removing the extension if any).

I am thinking of implementing a similar for basename, so you can get
the filename without the path. My idea is to use {/} as the basename
variable.

Would it be useful?

I think so.

Take one copy of all files. Skip dir. Overwrite duplicates:

  find | parallel cp {} /tmp/{/}

If so, what should the corresponding {2} and {2.} be called? Maybe:
{2/} and {2/.} ?

What is the difference between:
  {2.}
  {.2}
It must be something about how you delete.

{2/} or {/2} must then imply: remove 2 dirs from start or end of path.

/hans
--
Horsebakken 78, DK-2400 København NV

reply via email to

[Prev in Thread] Current Thread [Next in Thread]