POSIX Shell Programming Challenge - Programming On Unix
Users browsing this thread: 3 Guest(s)
|
|||
The idea I had is to print the content of test/ delimited with \0 by find(1) and loop over it, using readlink(1) to get the full path of the file.
Code: for i in `find test/ -mindepth 1 -maxdepth 1 -name '*' -print0` But it would require setting $IFS to \0. And setting $IFS to nul means that no splitting occurs rather than splitting on the nul character. EDIT: My answer is not qualified for the challenge. My find(1) man page says that the -print0 primary is a non-POSIX extension. But it could be easily replaced with -print, I think. |
|||