]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
When printing an executed command, don't print quote every parameter
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 4 Nov 2013 22:19:11 +0000 (23:19 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 4 Nov 2013 22:19:11 +0000 (23:19 +0100)
Only parameters containing spaces semicolons etc. are quoted.

novaboot

index 0e9f141ef77231ba7f60c7199f35e0e43ffa8c6a..435e753ce8793aca080e065fb61d3014ac953bec 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -328,9 +328,14 @@ sub generate_pulsar_config($$)
     return $filename;
 }
 
+sub shell_cmd_string(@)
+{
+    return join(' ', map((/^[-_=a-zA-Z0-9\/\.\+]+$/ ? "$_" : "'$_'"), @_));
+}
+
 sub exec_verbose(@)
 {
-    print "novaboot: Running: ".join(' ', map("'$_'", @_))."\n";
+    print "novaboot: Running: ".shell_cmd_string(@_)."\n";
     exec(@_);
 }