Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: script to return most recent file in a remote directory
- X-seq: zsh-users 13817
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: script to return most recent file in a remote directory
- Date: Tue, 10 Feb 2009 15:59:43 +0000 (UTC)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: SuccessTheory
- References: <Xns9BAE9FEDFBE5Bzzappergmailcom@xxxxxxxxxxxx> <dbfc82860902100752n570dcf2egcd3b83e8fa303115@xxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author