[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $(grep anycommand anyfile) fail
From: |
Paul Jarc |
Subject: |
Re: $(grep anycommand anyfile) fail |
Date: |
Wed, 24 Dec 2008 10:23:24 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
BlackEnvil <blackenvil@gmail.com> wrote:
> [blackenvil@space_star ~]$ cd $HOME; mkdir hello\ -world/; touch test; echo
> "ls hello\ -world/" > test; $(grep ls test);
> ls: invalid line width: orld/
Since $() is unquoted, it's simply split according to $IFS (at whitespace).
If you want full shell-language parsing instead, quote it and use
eval:
$ eval "$(grep ls test)"
paul