On 04/14/14 at 03:53pm, Vivek Goyal wrote:
On Sun, Apr 13, 2014 at 12:48:47PM +0800, WANG Chao wrote:
[..]
> > +is_fs_dump_target()
> > +{
> > + egrep -q "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf
> > +}
> > +
> > +is_user_configured_dump_target()
> > +{
> > + return $(is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target ||
is_fs_dump_target)
>
> Here $() is not correct for use.
>
> You should do this:
>
> is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target || is_fs_dump_target
>
> or
>
> return is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target ||
is_fs_dump_target
Why it is not correct to call above in a subshell. I am curious to know
what's wrong with that (apart from performance penalty).
It would go wrong when the subshell returns a string.
Actually in this case, nothing would go wrong. Because subshell doesn't
return anything back.
I'm just not too keen about such coding style.
Thanks
WANG Chao