Date: Sun, 13 May 2001 20:24:06 +0200 From: Gustaf Tham <gus@algonet.se> To: freebsd-questions@FreeBSD.org Subject: Re: COPY, CUT, PASTE (FILES) - PUT (0/1) Message-ID: <39ktftogb1skri4eo0oji29rf8bmkens4u@4ax.com> References: <3AFCE758.63DE32E1@iafrica.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39ktftogb1skri4eo0oji29rf8bmkens4u>