From owner-freebsd-questions Sun May 13 11:26: 9 2001 Delivered-To: freebsd-questions@freebsd.org Received: from knatte.tninet.se (knatte.tninet.se [195.100.94.10]) by hub.freebsd.org (Postfix) with SMTP id 0AFB737B423 for ; Sun, 13 May 2001 11:25:59 -0700 (PDT) (envelope-from gus@algonet.se) Received: (qmail 10322 invoked from network); 13 May 2001 20:25:56 +0200 Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103) by knatte.tninet.se with SMTP; 13 May 2001 20:25:56 +0200 Received: from laptop (sdu249-237.ppp.algonet.se [195.163.237.249]) by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.2) with ESMTP id 993494.778354.989garibaldi-s1 for ; Sun, 13 May 2001 20:25:54 +0200 From: Gustaf Tham To: freebsd-questions@FreeBSD.org Newsgroups: muc.lists.freebsd.questions Subject: Re: COPY, CUT, PASTE (FILES) - PUT (0/1) Date: Sun, 13 May 2001 20:24:06 +0200 Message-ID: <39ktftogb1skri4eo0oji29rf8bmkens4u@4ax.com> References: <3AFCE758.63DE32E1@iafrica.com> X-Mailer: Forte Agent 1.8/32.548 trialware MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I wrote a small shell script today that may do what you want, included below and as an attachment. Usage: When you see one or several files that you want to "copy", you write "put filename(s)" This can be repeated. When you are done, you go to your target directory and write "take". That's it. Put and take -- like fishing :-) NB: The gurus in the NG will have some things to say about my amateurish shell script. Well, the bumble bee doth fly. So far. Perhaps someone will write you something much nicer. In order to have just one shell script, called by either put or take, it has to be symlinked like this, First move put to the ../bin you use for non+official stuff. From that directory, type: ln +s put take As usual chmod a+x put, and rehash. Now it should work. My simplistic attempt looks like this: ____________________________________________________________________ : To be called by "put filename(s)" for saving filenames, and : subsequently with "take" without args for copying the selected : files to the working directory. : Gustaf Tham if test `basename $0` = put then C=0 for FNAME in $* do if test -d "$FNAME" then echo "$FNAME is a directory, skipping.." continue else echo `pwd`"/"$FNAME >> /tmp/silly C=`expr $C + 1` fi done echo "Saved $C filename(s)" else ########################################################### NAMES=`cat /tmp/silly` for NAME in $NAMES do cp -v $NAME . done echo "" > /tmp/silly fi _____________________________________________________________________ On 12 May 2001 09:33:44 +0200, ffkrz@iafrica.com (Francois Kritzinger) wrote: >Is there a way to copy, cut and then paste files from the shell? >E.g. "cut *.txt" and then "cd other_directory" and then "paste"... > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message