also sprach martin f krafft <madd...@debian.org> [2010.06.21.1229 +0200]: > This is also necessary, or else the fullname will be split at > whitespace. Setting $IFS ensures that lines are properly parsed and > split on tab characters.
This additional patch avoids the subshell even. -- .''`. martin f. krafft <madd...@d.o> Related projects: : :' : proud Debian developer http://debiansystem.info `. `'` http://people.debian.org/~madduck http://vcs-pkg.org `- Debian - when you have better things to do than fixing systems
From 8731edcec1ff669a81b6c73e5830d82d459f7e81 Mon Sep 17 00:00:00 2001 From: martin f. krafft <madd...@madduck.net> Date: Mon, 21 Jun 2010 12:44:28 +0200 Subject: [PATCH] avoid unnecessary subshell Signed-off-by: martin f. krafft <madd...@madduck.net> --- m_vcf.sh.in | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/m_vcf.sh.in b/m_vcf.sh.in index a47282f..b3da272 100644 --- a/m_vcf.sh.in +++ b/m_vcf.sh.in @@ -38,12 +38,10 @@ m_vcf_query() fi fi - $cmd | grep -i "$QUERY" | ( - IFS=" " # parse tab-separated fields - while read match1 match2 rest + $cmd | grep -i "$QUERY" | + while IFS=' ' read match1 match2 rest do echo "$match1 $match2 (VCF)" done - ) done } -- 1.7.1
digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)