Re: cp output format

2015-07-19 Thread Nicolas George
Le decadi 30 messidor, an CCXXIII, David Wright a écrit : And of course (unless the files are large (unlikely for .forward) and on the same mechanical drive), cmp file1 file2 is much simpler. I may've missed something here. I can't think why computing the md5/sha-2 digest would ever be

Re: cp output format

2015-07-19 Thread Andrew McGlashan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi, On 19/07/2015 7:59 PM, Nicolas George wrote: cmp /cdrom/300_megs_file_1 /cdrom/300_megs_file_2 ... and when you are done buying a replacement for your optical drive, you can tell me if cmp was really better than a hash. You make a very

Re: cp output format

2015-07-19 Thread David Wright
Quoting Nicolas George (geo...@nsup.org): Le decadi 30 messidor, an CCXXIII, David Wright a écrit : And of course (unless the files are large (unlikely for .forward) and on the same mechanical drive), cmp file1 file2 is much simpler. I may've missed something here. I can't think why

Re: cp output format

2015-07-19 Thread Haines Brown
On Sun, Jul 19, 2015 at 03:10:09AM +1000, Andrew McGlashan wrote: On 18/07/2015 9:40 PM, The Wanderer wrote: mmv file.~*~' file.#1 Okay, well from the OP ... $ cp --backup=t file /destination/file First time use of mmv: $ mmv file.~*~ file.#1 However, the next time

Re: cp output format

2015-07-19 Thread David Wright
Quoting Haines Brown (hai...@histomat.net): Andrew, thanks for your addition to this interesting thread. Unfortunately the implication is that no simple command will copy a file to another directory and avoid clash by sequentially numbering the copies. It will be simpler just to live with the

Re: cp output format

2015-07-18 Thread Wilko Fokken
On Thu, Jul 16, 2015 at 08:23:13AM -0400, Haines Brown wrote: Sorry for this elementary question. I want to do sequential copies with a command like this: $ cp --backup=t file .../destination/file. When periodically run it produces file, file.~1~, file.~2~, etc. How do I get rid of the ~ so

Re: cp output format

2015-07-18 Thread The Wanderer
On 07/18/2015 at 07:18 AM, Wilko Fokken wrote: On Thu, Jul 16, 2015 at 08:23:13AM -0400, Haines Brown wrote: Sorry for this elementary question. I want to do sequential copies with a command like this: $ cp --backup=t file .../destination/file. When periodically run it produces file,

Re: cp output format

2015-07-18 Thread Nicolas George
Le primidi 1er thermidor, an CCXXIII, Andrew McGlashan a écrit : Will that work with ANY shell? Of course not: it will not work with csh, antiquated Bourne shell nor with COMMAND.COM ;-) But will work with any standard-compliant implementation of sh, including dash and bash. Again will that

Re: cp output format

2015-07-18 Thread David Wright
Quoting Nicolas George (geo...@nsup.org): Le nonidi 29 messidor, an CCXXIII, Andrew McGlashan a écrit : md5_1=$(md5sum $HOME_DIR/.forward|cut -d\ -f1) md5_2=$(md5sum $wrk_dir/$fix_name/.forward|cut -d\ -f1) You can write md5=${md5%% *} instead of using cut, one fork+exec

Re: cp output format

2015-07-18 Thread Joel Rees
On Sat, Jul 18, 2015 at 8:40 PM, The Wanderer wande...@fastmail.fm wrote: On 07/18/2015 at 07:18 AM, Wilko Fokken wrote: On Thu, Jul 16, 2015 at 08:23:13AM -0400, Haines Brown wrote: Sorry for this elementary question. I want to do sequential copies with a command like this: $ cp --backup=t

Re: cp output format

2015-07-18 Thread Andrew McGlashan
Hi, On 17/07/2015 9:16 PM, Nicolas George wrote: Le nonidi 29 messidor, an CCXXIII, Andrew McGlashan a écrit : HOME_DIR=$(grep ^${fix_name}: /etc/passwd|cut -d: -f6) eval HOME_DIR=~$fix_name is much simpler, more efficient, and would work with NIS- or LDAP-based user databases.

Re: cp output format

2015-07-18 Thread Andrew McGlashan
On 18/07/2015 9:40 PM, The Wanderer wrote: mmv file.~*~' file.#1 Okay, well from the OP ... $ cp --backup=t file /destination/file First time use of mmv: $ mmv file.~*~ file.#1 However, the next time you try the cp again, it will create a new ~1~ as it doesn't exist and using mmv

Re: cp output format

2015-07-18 Thread David Wright
Quoting Wilko Fokken (wfok...@web.de): On Thu, Jul 16, 2015 at 08:23:13AM -0400, Haines Brown wrote: Sorry for this elementary question. I want to do sequential copies with a command like this: $ cp --backup=t file .../destination/file. When periodically run it produces file, file.~1~,

RE: cp output format

2015-07-17 Thread Arno Schuring
From: andrew.mcglas...@affinityvision.com.au Date: Fri, 17 Jul 2015 20:54:16 +1000 for filex in $(ls); [..] No. Just no. Regards, Arno -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble?

Re: cp output format

2015-07-17 Thread Andrew McGlashan
Hi, On 16/07/2015 10:23 PM, Haines Brown wrote: Sorry for this elementary question. I want to do sequential copies with a command like this: $ cp --backup=t file .../destination/file. When periodically run it produces file, file.~1~, file.~2~, etc. How do I get rid of the ~ so that the

Re: cp output format

2015-07-17 Thread Nicolas George
Le nonidi 29 messidor, an CCXXIII, Andrew McGlashan a écrit : Not sure if this is relevant enough, but I have a method to keep source files -- in this case .forward files in a controlled directory; if any of these differ from the target locations, then I save the target location file with a

Re: cp output format

2015-07-17 Thread shawn wilson
On Jul 17, 2015 7:16 AM, Nicolas George geo...@nsup.org wrote: Le nonidi 29 messidor, an CCXXIII, Andrew McGlashan a écrit : Not sure if this is relevant enough, but I have a method to keep source files -- in this case .forward files in a controlled directory; if any of these differ from

Pitfalls in rename, was Re: cp output format

2015-07-16 Thread David Wright
Quoting Renaud OLGIATI (ren...@olgiati-in-paraguay.org): On Thu, 16 Jul 2015 11:51:26 -0500 David Wright deb...@lionunicorn.co.uk wrote: How do I get rid of the ~ so that the backups are file.1, file.2, etc.? How about using the GNU rename in the dir holding your backup files:

cp output format

2015-07-16 Thread Haines Brown
Sorry for this elementary question. I want to do sequential copies with a command like this: $ cp --backup=t file .../destination/file. When periodically run it produces file, file.~1~, file.~2~, etc. How do I get rid of the ~ so that the backups are file.1, file.2, etc.? -- To UNSUBSCRIBE,

Re: cp output format

2015-07-16 Thread Ron
On Thu, 16 Jul 2015 08:23:13 -0400 Haines Brown hai...@histomat.net wrote: How do I get rid of the ~ so that the backups are file.1, file.2, etc.? How about using the GNU rename in the dir holding your backup files: $ rename ~ *~* Cheers, Ron. --

Re: cp output format

2015-07-16 Thread Ron
On Thu, 16 Jul 2015 11:51:26 -0500 David Wright deb...@lionunicorn.co.uk wrote: How do I get rid of the ~ so that the backups are file.1, file.2, etc.? How about using the GNU rename in the dir holding your backup files: $ rename ~ *~* Would that not be something more like

Re: cp output format

2015-07-16 Thread David Wright
Quoting Renaud OLGIATI (ren...@olgiati-in-paraguay.org): On Thu, 16 Jul 2015 08:23:13 -0400 Haines Brown hai...@histomat.net wrote: How do I get rid of the ~ so that the backups are file.1, file.2, etc.? How about using the GNU rename in the dir holding your backup files: $ rename ~