On 23/02/06 19:32, Daniele B. wrote:
> Remaning on the simplicity to do stuff.. did you ever try:
> 
> cd /home
> mkdir 5mode-com
> mv * 5mode-com/
> 
> I get:
> 
> rename 5mode-com to 5mode-com/5mode-com: invalid argument

That has to do with sh(1) globbing rules. The shell did exactly what you told it
to and expanded _everything_ in the present working directory. Then it attempted
to move all of that inside "5mode-com". But moving a directory inside of itself
is invalid, so it errored.

This happens on Linux too (demonstrated using termux on Android in this case,
but I guarantee you can reproduce this elsewhere).

~ $ cd $(mktemp -d)
.../tmp/tmp.7WQbdeMg3C $ pwd
/data/data/com.termux/files/usr/tmp/tmp.7WQbdeMg3C
.../tmp/tmp.7WQbdeMg3C $ touch file{1,2,3}
.../tmp/tmp.7WQbdeMg3C $ mkdir dir1
.../tmp/tmp.7WQbdeMg3C $ echo *
dir1 file1 file2 file3
.../tmp/tmp.7WQbdeMg3C $ mv * dir1/
mv: cannot move 'dir1' to a subdirectory of itself, 'dir1/dir1'
.../tmp/tmp.7WQbdeMg3C $ uname
Linux
.../tmp/tmp.7WQbdeMg3C $ echo $SHELL
/data/data/com.termux/files/usr/bin/bash

Reply via email to