Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Copy newest file to newest directory



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