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: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
}


-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Messages sorted by: Reverse Date, Date, Thread, Author