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 13816
- From: Nikolai Weibull <now@xxxxxxxx>
- To: zzapper <david@xxxxxxxxxx>
- Subject: Re: script to return most recent file in a remote directory
- Date: Tue, 10 Feb 2009 16:52:44 +0100
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=zUxW1bPjhm+GIZgZ9LidOAjAJuFtBvFXK9Put5l+mxI=; b=kM0zVXdy+KynJkf/62HqhXhmaFt9F2vUdXrUigEfM9GUZGpTCn6CdUqNC7kppdlA4E 6bmagIE9LERXaMSNN/6JHZqp9kogbiG+OYULiW7XT/rNhd5emorIhof9IKaNUhetbRUb nl8KOC2NAnSr9GY5HdWbpUWsAw1+QcY4Viq5k=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=d0SXe98VPqOpXr+hj4XxLCJN3jFMi3D5hqbm0CUak1DbjbCSuSQKtBybNzwBP/uPmq UGKUTZ3Py5tObHy/XjcnkhEUNg4oNcipDtql6MUjUj6OOzSGSFmFmpqfzXbtzOW8lyd2 PaQrGqITYKWbteLCliVUQm5YU8goJEnRM3NuQ=
- In-reply-to: <Xns9BAE9FEDFBE5Bzzappergmailcom@xxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns9BAE9FEDFBE5Bzzappergmailcom@xxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On Tue, Feb 10, 2009 at 16:43, zzapper <david@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx> wrote in
news:20061208134715.GC17120@xxxxxxxxxxxxxxx:
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
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author