[NTLUG:Discuss] Shell script help 2
Rev. wRy
slot0k at suicide.pogox.org
Sat May 13 09:23:03 CDT 2006
On Fri, May 12, 2006 at 05:49:30PM -0500, . Daniel wrote:
> bit. I may end up simply using rsync in the end but I still want to learn
> more shell scripting through this activity. In studying random examples on
> the web, I have come up with an interesting way of reading input from
> outside sources such as a file or the execution of a command.
Learning more is always great, but reinventing the wheel, not so much.
<snip>
> Here's the problem. As I mentioned, the for loop reads the output of
> "find" "word by word" and not "line by line." This presents a problem when
> filenames have spaces or other delimiter characters in them. Is there
> another way to read input line-by-line the way I need? I can create a
> temporary file containing the output of "find" but I don't see what good
> that does since it's something about the for loop that's making it
> word-by-word. Since this will not work, how can I read a file or output
> "line-by-line"?
awk & sed are your friends and mine.
RW
More information about the Discuss
mailing list