Re: How do I get a list of filenames with spaces on bash?



On Jan 24, 9:38 am, Stephane Chazelas <stephane_chaze...@xxxxxxxx>
wrote:
On Thu, 24 Jan 2008 11:04:29 -0600, Ed Morton wrote:

[...]

cp -- "$f" "$n" &&
rm -- "$f"
[...]
Why not mv? cp won't work great for non-regular files.

To ensure that in the event of a failure the original file is unaffected.

in that case, mv doesn't affect the file not even its inode, it
affects the current directory, it's just a rename. A failing
rename just leaves things as they are. A failing cp may leave an
unfinished copy around.

Also note that cp may not preserve file attributes like
permissions, ACLs, ownership, time stamps... (see -p option for
some of those).


And mv will preserve file attributes?

.



Relevant Pages

  • Re: How do I get a list of filenames with spaces on bash?
    ... To ensure that in the event of a failure the original file is unaffected. ... in that case, mv doesn't affect the file not even its inode, it ... affects the current directory, it's just a rename. ... A failing cp may leave an ...
    (comp.unix.shell)
  • Re: Demotion DC
    ... but the second DC is failing (Hard Disk problems) so I will need ... You cannot even EASILY rename ... contents of the failing drive to new disk. ... Accelerated MCSE ...
    (microsoft.public.win2000.active_directory)
  • [PATCH] scripts/unifdef.c: rename getline symbol to something else
    ... Rawhide builds are currently failing to build unifdef.c, ... version of glibc changes the default _POSIX_C_SOURCE level, ... exposes getline() from ... Rename the symbol in unifdef.c to parseline to avoid this conflicting ...
    (Linux-Kernel)
  • Re: Fastcode CharPosRev B&V 0.8.0
    ... I know but it does not make sense to rename a failing function and include ... Jeg beskyttes af den gratis SPAMfighter til privatbrugere. ...
    (borland.public.delphi.language.basm)