Some other ways
Code:
% set -- $(<file)
% paste -d" " <(printf "cp -pr %s\n" "${@##*/}") <(printf "%s\n" "$@")
cp -pr a.dbf /data/a.dbf
cp -pr b.dbf /data/june/b.dbf
and with zsh:
Code:
zsh 4.3.4% <file while IFS= read;do print -r "cp -pr $REPLY:t $REPLY";done
cp -pr a.dbf /data/a.dbf
cp -pr b.dbf /data/june/b.dbf
or awk:
Code:
zsh 4.3.4% awk '$0="cp -pr "$NF" "$0' FS="/" file
cp -pr a.dbf /data/a.dbf
cp -pr b.dbf /data/june/b.dbf
|