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

Re: script to return most recent file in a remote directory



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