|
From: | bash |
Subject: | Re: Spaces in args, escapes, and command substitution |
Date: | Wed, 25 Oct 2006 09:50:36 +1000 |
> >> For example, "vi `grep -l *.c`" is fine so long as there are no spaces >> in the *.c filenames. But if there are, then the split on space >> that command subsitution does messes everything up. >> >> Given that "grep -l" outputs newline-delimited result then surely there >> should it should be possibly to have the spaces on each line escaped >> and only the newlines converted to spaces. > >Word splitting is controlled by IFS. Use IFS=$'\n' to only split on >newlines. Tried that. Doesn't work. Perhaps instead of just saying "Use IFS..." you could show me a working example.
[Prev in Thread] | Current Thread | [Next in Thread] |