From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] network/nfs_lib.sh: Use double quotes for grep pattern
Date: Wed, 17 Jun 2020 20:43:56 +0200 [thread overview]
Message-ID: <20200617184356.GA7422@dell5510> (raw)
In-Reply-To: <423c55db-a393-d1d9-6de6-28f65f76557a@oracle.com>
Hi Alexey, Xiao,
> Perhaps this:
> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index 59b373e..9c8f163 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -172,8 +172,7 @@ tst_rhost_run()
> local output=
> local ret=0
> if [ -n "${TST_USE_SSH:-}" ]; then
> - output=`ssh -n -q $user@$RHOST "sh -c \
> - '$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
> + output=$(ssh -n -q $user@$RHOST "$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR')
> elif [ -n "$TST_USE_NETNS" ]; then
> output=`$LTP_NETNS sh -c \
> "$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'`
Nice! Much simpler than what what I was just going to post (sed replacement).
Would it work for rsh as well? i.e. can it work without sh -c?
I have no working rsh setup.
And removing it from all 3 variants would be great (keeping them to be the same,
also it might allow to also use shell functions, which doesn't work with sh -c
"..."). Why was sh -c "..." used anyway?
BTW I have more tst_net.sh, but I post them after we solve this one (as
replacing quotes with sed, which is in my prepared patchset is ugly).
Kind regards,
Petr
next prev parent reply other threads:[~2020-06-17 18:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-08 14:27 [LTP] [PATCH] network/nfs_lib.sh: Use double quotes for grep pattern Xiao Yang
2020-06-08 14:58 ` Petr Vorel
2020-06-09 6:14 ` Xiao Yang
2020-06-17 14:28 ` Alexey Kodanev
2020-06-17 18:43 ` Petr Vorel [this message]
2020-06-18 12:38 ` Alexey Kodanev
2020-06-18 13:23 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200617184356.GA7422@dell5510 \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox