aboutsummaryrefslogtreecommitdiff
path: root/lib/remote.exp
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2016-01-12 11:56:51 +1100
committerBen Elliston <bje@gnu.org>2016-01-12 11:56:51 +1100
commit9d2158eb167756e61aae8e91754d6efcf1ee5fb5 (patch)
tree4f803156e116966df6802b5a5207ae0d7151ef49 /lib/remote.exp
parent25540046c5d77618c94b95115b187d7ff9acac0b (diff)
downloaddejagnu-9d2158eb167756e61aae8e91754d6efcf1ee5fb5.zip
dejagnu-9d2158eb167756e61aae8e91754d6efcf1ee5fb5.tar.gz
dejagnu-9d2158eb167756e61aae8e91754d6efcf1ee5fb5.tar.bz2
* lib/remote.exp (standard_file): The [ operator does not actually
output anything. It returns 0 or 1 as its exit code, so "exit `[ -f $file ]`" always expands to "exit " (equivalent to exit 0). Instead, use test(1) to check for file existence. Signed-off-by: Ben Elliston <bje@gnu.org>
Diffstat (limited to 'lib/remote.exp')
-rw-r--r--lib/remote.exp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/remote.exp b/lib/remote.exp
index fb040bb..bddf2ae 100644
--- a/lib/remote.exp
+++ b/lib/remote.exp
@@ -765,8 +765,7 @@ proc standard_file { dest op args } {
}
switch $op {
exists {
- # mmmm, quotes.
- set status [remote_exec $dest "sh -c 'exit `\[ -f $file \]`'"]
+ set status [remote_exec $dest "test -f $file"]
return [lindex $status 0]
}
delete {