Timeline for moving files matching a pattern that catches the directory
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 1, 2018 at 22:59 | answer | added | Kamil Maciorowski | timeline score: 2 | |
Apr 16, 2018 at 19:00 | comment | added | Erwann | I have made edits according to your suggestion, but they don't tell us anything new. I'm using the same bash version, that was already in the question. I would have hoped there existed a regex way to restrict the source to type file. | |
Apr 16, 2018 at 18:55 | history | edited | Erwann | CC BY-SA 3.0 |
Answering a suggestion in one comment
|
Apr 16, 2018 at 1:27 | comment | added | AFH |
It's not clear what is going on, but shell expansion can't be limited to files: you need to use find or for f in *foo*; do [ -f "$f" ] && mv "$f" foo; done . Please update your question with the results on repeating both tests using ls -F each time and mv -v in both the find ... -exec and the stand-alone command. I'm using Ubuntu 16.04.04 with GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu) . If foo is a directory and xyfooz.tex a file, my stand-alone mv gives mv: cannot move 'foo' to a subdirectory of itself, 'foo/foo' , which is as expected. What OS are you using?
|
|
Apr 16, 2018 at 0:01 | history | asked | Erwann | CC BY-SA 3.0 |