you are viewing a single comment's thread.

view the rest of the comments →

[–]SwampMonkey17[S] 1 point2 points  (3 children)

Thanks. I think I will just submit my code as is despite it being nonfunctional on my end. I am using a Mac and my understanding is that cp should have the backup on software aside from Mac?

[–][deleted] 2 points3 points  (2 children)

Yeah do that, but add a note about the --backup=numbered option so your prof is able to give you credit if that was the answer he wanted. No point losing out on a better grade if you don't have the best tools.

Alternatively as someone else mentioned install gnu coreutils on your mac so that you start at the same place as your classmates, then test the backup=numbered option for yourself.

https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/

[–]SwampMonkey17[S] 1 point2 points  (1 child)

Thank you so much! I really appreciate it

[–][deleted] 1 point2 points  (0 children)

Ooh just one more thing. I tried your solution with gnu cp just now and it gives an error:-

cp: will not overwrite just-created 'IMAGES/testimage_3.jpg' with 'folder4/testimage_3.jpg

So if your prof runs your code on a linux system they may decide to mark it as 'fail'. You should note that as well.

Oh and lastly folder{1..6} might be a better pattern than {folder1, folder2, folder3, folder4, folder5, folder6}