[Digikam-users] Not completely but a bit off topic question: looking for texteditor with macro capabillity

Dan McDaniel dan at dm3.us
Sun Aug 28 21:34:42 BST 2011


On Sun 28.Aug.11 19:55, sleepless wrote:
>Op 28-08-11 19:27, Benjamin GIRAULT schreef:
>>2011/8/28 Johnny<yggdrasil at gmx.co.uk>:
>>>sleepless<sleeplessregulus at hetnet.nl>  writes:
>>>
>>>>Hi linux people,
>>>>
>>>>I have been wrestling a bit and ran quite quick in some sort of obstacle.
>>>>
>>>>this works fine
>>>>mv *.* ../TEMP2/
>>>>
>>>>
>>>>but this one
>>>>  for f in $(ls); do mv ${f} ../TEMP2/; done
>>>>
>>>>does not work if you have file names with spaces.
>>>>
>>>>does that mean that for comfortable working in linux I have to rename
>>>>my 1 billion files to file_names_like_this.ext?
>>>>
>>>No, you can just use something like
>>>,----
>>>| for f in "$(ls)"; do mv "${f} ../TEMP2/"; done
>>>`----
>>>to handle spaces.
>>That may not work because the second " character does not seem to be
>>at the right place. Try this:
>>
>>,----
>>| for f in "$(ls)"; do mv "${f}" ../TEMP2/; done
>>`----
>>
>I tried the quotes at lots of different places, but no luck.
>I just found a page somewhere stating that it will never work with 
>for. For will always break the line despite of the quotes.
>It seems to be possible with while, but thats another story.

This seems to work:

   for f in *; mv "$f" ../TEMP2; done

If the target folder also has spaces then quote it as well:

   for f in *; mv "$f" "../TEMP 2"; done

Dan





More information about the Digikam-users mailing list