Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Copy newest file to newest directory
- X-seq: zsh-users 11069
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Copy newest file to newest directory
- Date: Fri, 8 Dec 2006 13:25:30 +0000 (UTC)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: SuccessTheory
- References: <Xns98937B980EE3Ezzappergmailcom@xxxxxxxxxxx> <20061208122238.GA17120@xxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
Frank Terbeck <ft@xxxxxxxxxxxxxxxxxx> wrote in news:20061208122238.GA17120
@fsst.voodoo.lan:
> zzapper <david@xxxxxxxxxx>:
>> I have some global aliases which call scripts such that I can write
>>
>> > cp NF ND
>> Where NF copies the newest file to ND the newest directory
>
> [snip]
> function cpn() {
> local nf nd
> nf=${1}/*(.om[1]N)
> nd=${2}/*(/om[1]N)
> [[ -n ${nd} && -n ${nf} ]] && command cp ${nf} ${nd}
> }
> [snap]
>
> % cpn /tmp /store
>
Frank,
Looks the business, but not does not work for me
--
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips
Messages sorted by:
Reverse Date,
Date,
Thread,
Author