ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
hi, i am trying to recurse into directories and delete only files.
Code:
cat set-share.bash
#!/bin/bash
for line in "`find nov`"
do
# echo "$line"
rm "$line"
done
set-share.bash
...
nov/stuff/folder - two/link to file.lnk
nov/Projects/name - of - directory
nov/Projects/RE access.msg
nov/Security: A file or path name is too long.
find nov | wc -l
235
# to find the longest fine-name find nov | cut -b 50- | more
nov/Projects/very long project name/very long project name - very long project requirements description_11-21-05.xls
longname="nov/Projects/very long project name/very long project name - very long project requirements description_11-21-05.xls"
rm "$longname" #works
can someone explain why this is failing or have a better idea,
thanks,
because of the quotes around "`find nov`" it considers all 235 lines one long file-name. but without the quotes file-names with spaces will get truncated. is there another way to 'wrap' file-names that contain spaces?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.