View Single Post
  #8   (View Single Post)  
Old 15th August 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

Quote:
Originally Posted by Carpetsmoker View Post
KillaSmurf's script doesn't use quotes:

Code:
  for fileName in $1/*
I said that the dir Code_Of_Tha_Street_[2003] is probably empty.

Ok, now i will present my line of reasoning:

First note that $1/* in the for statement correctly globs the dir.
Run the following to convince yourself:
$ mkdir test
$ touch "test/Street [2003]"
$ export d=test
$ for f in $d/* ; do echo "$f" ; done

Now, lets take this error as an example:
Code:
chmod: /home/share/music/mp3/151/Code_Of_Tha_Street_[2003]/*: No such file or directory
At some point the func. RenameFile() is called with the arg. "/home/share/music/mp3/151", ie. $1=/home/share/music/mp3/151.
we then enter the for loop where the dir Code Of Tha Street [2003] is converted to Code_Of_Tha_Street_[2003] (unless ofcourse those were underscores to begin).

Next, RenameFile() is called with Code_Of_Tha_Street_[2003] and the for loop
entered with $fileName="Code_Of_Tha_Street_[2003]/*"

chmod uog-x "$fileName" will now generate the given error.

I have had enough of this discussion and I will have nothing more to say on this thread.

Last edited by ephemera; 15th August 2008 at 04:38 PM.
Reply With Quote