Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: copying files with shell built in functions?
- X-seq: zsh-users 5992
- From: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
- To: dominik.vogt@xxxxxx, "'Zsh Users'" <zsh-users@xxxxxxxxxx>
- Subject: RE: copying files with shell built in functions?
- Date: Fri, 28 Mar 2003 20:30:18 +0300
- Importance: Normal
- In-reply-to: <20030328165928.GB14934@xxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
> In a fit of mental derangement, my colleagues tried to exchange
> the libc on a machine at run time and used 'mv' to rename the
> file. As you might imagine, they regretted that immediately :-)
>
> Can anyone think of a way to copy or rename a file with only shell
> built in functions? (either zsh or bash) I have tried things
> like
>
> $ while read <options> X; do echo <options> "$X"; done < ifile > ofile
>
> and
>
> $ echo $(< ifile) > ofile
>
> (does not work because echo destroys XR and LF)
>
> or
>
> $ cat <<EOF > ofile
> $(< ifile)
> EOF
>
> (does not work because it still needs a cat and the here document
> is mangled.
>
bor@itsrm2% zmodload zsh/files
bor@itsrm2% which mv
mv: shell built-in command
bor@itsrm2% which rm
rm: shell built-in command
bor@itsrm2% man zshmodules
bor@itsrm2% echo $ZSH_VERSION
4.0.4
-andrey
Messages sorted by:
Reverse Date,
Date,
Thread,
Author