From c417e799a7e8b6a15138a396447adc896646819a Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 18 Dec 2012 13:44:51 +0000 Subject: [PATCH] fix for defect 3249 xdsh -e with relative path git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14677 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/xdsh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/xCAT-client/bin/xdsh b/xCAT-client/bin/xdsh index b9a59be91..41300c39f 100644 --- a/xCAT-client/bin/xdsh +++ b/xCAT-client/bin/xdsh @@ -329,11 +329,17 @@ sub parse_args_xdsh xCAT::DSHCLI->show_dsh_config; exit 0; } - # -if -e flag, execute script have to do special processing for hierarchy - # in the plugin - if ($options{'execute'}) - { - $ENV{'DSHEXECUTE'} = join ' ', @ARGV; # execute script + my $executescript; + #check for full path to file + if ($options{execute}) + { + # this can be a file + parameters + $executescript = join ' ', @ARGV; + if ($executescript !~ /^\//) { + #relative path + $executescript = xCAT::Utils->full_path($executescript); + } + $ENV{'DSHEXECUTE'} = $executescript; # execute script } # find out who is the current user running xdsh