diff options
-rwxr-xr-x | etc/bash_completion.d/20vyatta-cfg | 5 | ||||
-rw-r--r-- | scripts/vyatta-comment-config.pl | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index af9a1b4..f0f621b 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -448,10 +448,7 @@ comment() if [ "$#" -eq "0" ]; then return 0 fi - args=("$@") - #now need to replace last element - args[${#args[*]}-1]="\"${args[${#args[*]}-1]i}\""; - eval "${vyatta_sbindir}/vyatta-comment-config.pl ${args[*]}" + ${vyatta_sbindir}/vyatta-comment-config.pl "$@" } activate() diff --git a/scripts/vyatta-comment-config.pl b/scripts/vyatta-comment-config.pl index 8ef4cb6..2cbd81d 100644 --- a/scripts/vyatta-comment-config.pl +++ b/scripts/vyatta-comment-config.pl @@ -71,7 +71,13 @@ if ($ARGV[$#ARGV] eq '') { `rm -f $full_path/.comment`; } else { - `echo \"$ARGV[$#ARGV]\" > $full_path/.comment`; + my $cfile; + if (!open($cfile, '>', "$full_path/.comment")) { + print "Failed to set comment\n"; + exit 1; + } + print $cfile $ARGV[$#ARGV]; + close($cfile); } print "Done\n"; |