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
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.
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
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
...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
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
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 ||
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
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)
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
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
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
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
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
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
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
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
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'
$ 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
19 matches
Mail list logo