From 7238c7391b457e71249d158a184e1314362d3cc9 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 5 May 2016 04:06:24 -0400 Subject: [PATCH] make ubuntu as a specific scenario --- xCAT-test/xcattest | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index d84c965f3..13a549dc3 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -22,6 +22,12 @@ my $needshow = 0; my $restore = 0; my $ret = 0; my $string1 = undef; + +my $isubuntu=0; +my $output=`cat /etc/lsb-release 2>&1 |grep -i Ubuntu| wc -l`; +chomp($output); +$isubuntu=1 if($output > 0); + if ( !GetOptions("h|?" => \$needhelp, "f=s" => \$configfile, @@ -882,7 +888,14 @@ sub runcmd my $rc = 0; $::RUNCMD_RC = 0; my $outref = []; - @$outref = `/bin/bash -lic '$cmd 2>&1'`; + + if($isubuntu){ + $cmd=~s/(")/\\\1/g; + $cmd=~s/(`)/\\\1/g; + @$outref = `/bin/bash -lic "$cmd 2>&1"`; + }else{ + @$outref = `$cmd 2>&1`; + } if ($?) { $rc = $? ;