zsh-users
 help / color / mirror / code / Atom feed
* script to return most recent file in a remote directory
@ 2009-02-10 15:43 zzapper
  2009-02-10 15:52 ` Nikolai Weibull
  0 siblings, 1 reply; 4+ messages in thread
From: zzapper @ 2009-02-10 15:43 UTC (permalink / raw)
  To: zsh-users

Hi
Somebody wrote me a script to copy the newest file in a distant directory to 
the current directory, unfortunately I can't find it, (it was at least a year 
ago)

eg
> copy_newest_file_in_dir   /path/to/dir/

BTW the archive search at 
http://www.zsh.org/cgi-bin/mla/wilma/users
doesnt seem to be working

-- 
zzapper
http://www.successtheory.com/tips/vimtips.html
http://www.successtheory.com/tips/cygwintips.php   (in progress)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: script to return most recent file in a remote directory
  2009-02-10 15:43 script to return most recent file in a remote directory zzapper
@ 2009-02-10 15:52 ` Nikolai Weibull
  2009-02-10 15:59   ` zzapper
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolai Weibull @ 2009-02-10 15:52 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

On Tue, Feb 10, 2009 at 16:43, zzapper <david@tvis.co.uk> wrote:

> Somebody wrote me a script to copy the newest file in a distant directory to
> the current directory, unfortunately I can't find it, (it was at least a year
> ago)

Do you mean the following?

Frank Terbeck <ft@bewatermyfriend.de> wrote in
news:20061208134715.GC17120@fsst.voodoo.lan:

Frank
Thanks I've just added an echo

function cpn()
{
 setopt localoptions
 setopt globassign
 local nf nd
 [[ -z ${1} || -z ${2} ]] && printf 'usage: cpn <fromdir> <todir>\n' &&
return 1
 nf=${1}/*(.om[1]N)
 nd=${2}/*(/om[1]N)
 result="cp $nf $nd"
 [[ -n ${nd} && -n ${nf} ]] && command cp ${nf} ${nd} ; echo $result
}


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: script to return most recent file in a remote directory
  2009-02-10 15:52 ` Nikolai Weibull
@ 2009-02-10 15:59   ` zzapper
  2009-02-10 16:50     ` Nikolai Weibull
  0 siblings, 1 reply; 4+ messages in thread
From: zzapper @ 2009-02-10 15:59 UTC (permalink / raw)
  To: zsh-users

Nikolai Weibull wrote in

> 
> function cpn()
> {
>  setopt localoptions
>  setopt globassign
>  local nf nd
>  [[ -z ${1} || -z ${2} ]] && printf 'usage: cpn <fromdir> <todir>\n' &&
> return 1
>  nf=${1}/*(.om[1]N)
>  nd=${2}/*(/om[1]N)
>  result="cp $nf $nd"
>  [[ -n ${nd} && -n ${nf} ]] && command cp ${nf} ${nd} ; echo $result
> }
> 
Yes thanks (how/where did you find it?)

-- 
zzapper



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: script to return most recent file in a remote directory
  2009-02-10 15:59   ` zzapper
@ 2009-02-10 16:50     ` Nikolai Weibull
  0 siblings, 0 replies; 4+ messages in thread
From: Nikolai Weibull @ 2009-02-10 16:50 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

On Tue, Feb 10, 2009 at 16:59, zzapper <david@tvis.co.uk> wrote:

> > Nikolai Weibull wrote in
> > ...

> Yes thanks (how/where did you find it?)

My archive.  I'm sure you could find it via gmane or something like that.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-10 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-10 15:43 script to return most recent file in a remote directory zzapper
2009-02-10 15:52 ` Nikolai Weibull
2009-02-10 15:59   ` zzapper
2009-02-10 16:50     ` Nikolai Weibull

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).