From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5487 invoked from network); 28 Mar 2003 17:32:48 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 28 Mar 2003 17:32:48 -0000 Received: (qmail 23416 invoked by alias); 28 Mar 2003 17:30:26 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5992 Received: (qmail 23398 invoked from network); 28 Mar 2003 17:30:25 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 28 Mar 2003 17:30:25 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [192.35.17.28] by sunsite.dk (MessageWall 1.0.8) with SMTP; 28 Mar 2003 17:30:25 -0000 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.11.6/8.11.6) with ESMTP id h2SHUP205149; Fri, 28 Mar 2003 18:30:25 +0100 (MET) Received: from MOWD019A.mow.siemens.ru ([163.242.196.119]) by mail1.siemens.de (8.11.6/8.11.6) with ESMTP id h2SHUOt03170; Fri, 28 Mar 2003 18:30:24 +0100 (MET) Received: by mowd019a.mow.siemens.ru with Internet Mail Service (5.5.2653.19) id ; Fri, 28 Mar 2003 20:33:14 +0300 Received: from mw2b210c (163.242.193.12 [163.242.193.12]) by MOWD019A.mow.siemens.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id HZBJXB23; Fri, 28 Mar 2003 20:33:13 +0300 From: Borzenkov Andrey To: dominik.vogt@gmx.de, "'Zsh Users'" Subject: RE: copying files with shell built in functions? Date: Fri, 28 Mar 2003 20:30:18 +0300 Message-ID: <6134254DE87BD411908B00A0C99B044F03A0B6A0@mowd019a.mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 In-Reply-To: <20030328165928.GB14934@gmx.de> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal > 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 X; do echo "$X"; done < ifile > ofile > > and > > $ echo $(< ifile) > ofile > > (does not work because echo destroys XR and LF) > > or > > $ cat < 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