bug#5926: feature request: mv -p to create missing target dir

2014-10-22 Thread f0rhum
I mean why wasn't refused cp -p request, saying just use mkdir first. There seems to be a good deal of confusion here, as cp -p has nothing to do with mkdir -p. Oooops, sorry, I meant: why wasn't refused mkdir -p option request, saying just use ls and mkdir first? Hmmm, ok, I see they are

bug#5926: feature request: mv -p to create missing target dir

2014-10-21 Thread Paul Eggert
f0r...@free.fr wrote: I mean why wasn't refused cp -p request, saying just use mkdir first. There seems to be a good deal of confusion here, as cp -p has nothing to do with mkdir -p.

bug#5926: feature request: mv -p to create missing target dir

2014-10-20 Thread f0rhum
The mv command causes an atomic rename(2) to occur if on the same file system. That is not possible when using cp + rm. Therefore mv is required. Hi Bob. I am just trying to understand why this very request is refused with the argument small is beautiful, when the -p was accepted for cp: I

bug#5926: feature request: mv -p to create missing target dir

2014-10-20 Thread Andreas Schwab
Bob Proulx b...@proulx.com writes: The mv command causes an atomic rename(2) to occur if on the same file system. That is not possible when using cp + rm. Therefore mv is required. Also, you can rename a file that you cannot read. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key

bug#5926: feature request: mv -p to create missing target dir

2014-10-19 Thread f0rhum
...is mv counter to The Unix Philosophy ? Small is beautiful. Make each program do one thing well. Choose portability over efficiency. Use shell scripts to increase leverage and portability. Would mv be discarded to the benefit of cp + rm? Ok, I know we can't because mv also does in

bug#5926: feature request: mv -p to create missing target dir

2014-10-19 Thread Bob Proulx
f0rhum wrote: ...is mv counter to The Unix Philosophy ? Small is beautiful. Make each program do one thing well. Choose portability over efficiency. Use shell scripts to increase leverage and portability. Would mv be discarded to the benefit of cp + rm? Ok, I know we can't

bug#5926: feature request: mv -p to create missing target dir

2010-04-26 Thread Stefano Lattarini
Just a few obsevations on side issues... Bob Proulx writes: Rodolfo Borges wrote: cat EOF ~/.bashrc function mv() { local target=${!#} local dir if [[ $target =~ '/$' ]]; then dir=$target else dir=$(dirname $target) fi test -d $dir ||

bug#5926: feature request: mv -p to create missing target dir

2010-04-26 Thread Andreas Schwab
Stefano Lattarini stefano.lattar...@gmail.com writes: Just a few obsevations on side issues... Bob Proulx writes: Rodolfo Borges wrote: cat EOF ~/.bashrc function mv() { local target=${!#} local dir if [[ $target =~ '/$' ]]; then dir=$target else

bug#5926: feature request: mv -p to create missing target dir

2010-04-26 Thread Jim Meyering
Stefano Lattarini wrote: Just a few obsevations on side issues... Bob Proulx writes: Rodolfo Borges wrote: cat EOF ~/.bashrc function mv() { local target=${!#} local dir if [[ $target =~ '/$' ]]; then dir=$target else dir=$(dirname $target)

bug#5926: feature request: mv -p to create missing target dir

2010-04-26 Thread Andreas Schwab
Jim Meyering j...@meyering.net writes: Using env is the most portable, at the expense of a fork (compared to bash's command): Note that command is also part of the POSIX shell. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B

bug#5926: feature request: mv -p to create missing target dir

2010-04-26 Thread Stefano Lattarini
At Monday 26 April 2010, Jim Meyering j...@meyering.net wrote: Using env is the most portable, at the expense of a fork (compared to bash's command): env mv $@ Generally, this is true. But Rodolfo was assuming bash as his shell anyway, and in this case the use of well-estabilished bash

bug#5926: feature request: mv -p to create missing target dir

2010-04-26 Thread Stefano Lattarini
At Monday 26 April 2010, Andreas Schwab sch...@linux-m68k.org wrote: I think that's needed because otherwise the shell function would end up calling itself recursively, since it's named `mv' too. You use command mv for that. Good point, I forgot about that. And it works for shell

bug#5926: feature request: mv -p to create missing target dir

2010-04-25 Thread Rodolfo Borges
On Sun, Apr 25, 2010 at 10:29 AM, Stefano Lattarini stefano.lattar...@gmail.com wrote: Just a few obsevations on side issues...     $(which mv) $@ I think that's needed because otherwise the shell function would end up calling itself recursively, since it's named `mv' too. exactly. The

bug#5926: feature request: mv -p to create missing target dir

2010-04-24 Thread Bob Proulx
Rodolfo Borges wrote: Bob Proulx wrote: Rodolfo Borges wrote: $ :( bash: syntax error near unexpected token `newline' ... $ :) bash: syntax error near unexpected token `)' Using this format to tell us what you are thinking is very confusing! It seems you haven't got the writing

bug#5926: feature request: mv -p to create missing target dir

2010-04-24 Thread Alan Curry
Bob Proulx writes: As a side comment I don't see the point of: $(which mv) $@ I can guess the point: bash$ alias mv='mv -i' bash$ touch a b bash$ mv a b mv: overwrite `b'? ^C bash$ $(which mv) a b bash$ ls -l a b ls: cannot access a: No such file or directory -rw--- 1 pacman

bug#5926: feature request: mv -p to create missing target dir

2010-04-24 Thread Bob Proulx
Alan Curry wrote: Bob Proulx writes: As a side comment I don't see the point of: $(which mv) $@ I can guess the point: bash$ alias mv='mv -i' bash$ touch a b bash$ mv a b mv: overwrite `b'? ^C bash$ $(which mv) a b Good observation. Yes, but... Using aliases in general

bug#5926: feature request: mv -p to create missing target dir

2010-04-16 Thread Rodolfo Borges
On Thu, Apr 15, 2010 at 8:13 PM, Bob Proulx b...@proulx.com wrote: Rodolfo Borges wrote: $ mv foo ~/some/path/ mv: cannot create regular file `/home/bart9h/some/path/': Is a directory No target directory exists. $ mkdir -p ~/some/path/ $ mv foo ~/some/path/ That seems like the best way

bug#5926: feature request: mv -p to create missing target dir

2010-04-15 Thread Bob Proulx
Rodolfo Borges wrote: $ mv foo ~/some/path/ mv: cannot create regular file `/home/bart9h/some/path/': Is a directory No target directory exists. $ mkdir -p ~/some/path/ $ mv foo ~/some/path/ That seems like the best way to do it. $ :( bash: syntax error near unexpected token `newline'

bug#5926: feature request: mv -p to create missing target dir

2010-04-12 Thread Rodolfo Borges
$ mv foo ~/some/path/ mv: cannot create regular file `/home/bart9h/some/path/': Is a directory $ mkdir -p ~/some/path/ $ mv foo ~/some/path/ $ :( bash: syntax error near unexpected token `newline' $ $ $ pacman -Sy coreutils (... upgrades package ...) $ $ $ mv -vp foo ~/some/path/ mv: created