Skip to main content
9 events
when toggle format what by license comment
Mar 22, 2015 at 13:15 comment added Costas @Demontager I have check script againe and found logical mistake: reverse grep (with -v option) everytime is true because other lines in folder_list.txt is accepted to pattern. Repaired.
Mar 22, 2015 at 13:09 history edited Costas CC BY-SA 3.0
remove last / not first and reverce grep by ! to one line accept
Mar 22, 2015 at 2:14 comment added Demontager @Costas Double checked, my list.txt contains folder1 folder2 test.sh list.txt now if i run it does nothing. Have a look on this simplest-image-hosting.net/jpeg-0-122mz
Mar 21, 2015 at 21:26 history edited Gilles 'SO- stop being evil' CC BY-SA 3.0
simplify the script, with a side benefit that it doesn't break on spaces and wildcards; fix the bug that it would match substrings
Mar 21, 2015 at 17:41 comment added Costas @Demontager Suppose the problem in your folder_list.txt file. Check it by grep "some_folder_name" folders_list.txt
Mar 21, 2015 at 14:47 comment added Demontager @Costas I tested your approach it deletes all folders. Also in my particular task folders are not named like folder1,2,3 they have not similar names. No spaces and dots before names, but they have dots inside like: bar.org foo.com
Mar 21, 2015 at 14:20 history edited terdon CC BY-SA 3.0
Removed syntax highlighting since it breaks on *
Mar 21, 2015 at 13:40 comment added Chris Davies You can find /target_folder -maxdepth 1 -type d | while IFS= read folder; do ... done if the folder names contain spaces or start with a dot.
Mar 21, 2015 at 10:57 history answered Costas CC BY-SA 3.0