Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1478587 Details for
Bug 1622187
Man page exec section confusing, variable substitution not working correctly, quit takes far too long
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for man page, quit command and variable substitutions.
swatch.patch (text/plain), 2.17 KB, created by
John Horne
on 2018-08-24 16:12:36 UTC
(
hide
)
Description:
Patch for man page, quit command and variable substitutions.
Filename:
MIME Type:
Creator:
John Horne
Created:
2018-08-24 16:12:36 UTC
Size:
2.17 KB
patch
obsolete
>--- swatch.orig 2014-12-10 18:52:24.000000000 +0000 >+++ swatch 2018-08-24 15:28:11.238077819 +0100 >@@ -656,17 +656,19 @@ > my $varname = shift; > my $command = shift; > my @new_cmd = (); >+ my $i = my $n = my $m; > >- $command =~ s/\$[0*]/\$$varname/g if $awk_field_syntax; >+ $command =~ s/(?<!\\)\$[0*]/\$$varname/g; > >- foreach my $i (split(/\s+/, $command)) { >- if ($awk_field_syntax and $i =~ /\$([0-9]+)/) { >- my $n = substr($i, 1); >- $n--; >- push(@new_cmd, "\$$varname\[$n\]"); >- } else { >- push(@new_cmd, $i); >+ foreach $i (split(/\s+/, $command)) { >+ if ($awk_field_syntax) { >+ while ($i =~ /(?<!\\)\$([1-9]+)/) { >+ $n = $1; >+ $m = $n - 1; >+ $i =~ s/\$$n/\$$varname\[$m\]/; >+ } > } >+ push(@new_cmd, $i); > } > > return join(' ', @new_cmd); >@@ -740,7 +742,7 @@ > } > > if ($do_quit) { >- $code .= " exit;\n"; >+ $code .= " &goodbye;\n"; > } elsif (not $do_continue) { > $code .= " next;\n"; > } >@@ -1063,7 +1065,7 @@ > > Use this option only if you want to overide regular expression backreferencing > in favor of B<awk(1)> style field referencing. Included for backward >-compatability. >+compatibility. > > =item B<--config-file|-c> I<filename> > >@@ -1213,9 +1215,17 @@ > =item B<exec command> > > Execute I<command>. The I<command> may contain variables which are >-substituted with fields from the matched line. A I<$N> will be replaced >-by the I<Nth> field in the line. A I<$0> or I<$*> will be replaced by the >-entire line. >+substituted with fields from the matched line. If the B<--awk-field-syntax> >+command-line option has been specified, then each I<$N> will be replaced >+by the I<Nth> field in the line. If the option has not been specified, >+then each I<$N> will refer to a backreference in the regular expression >+used to match the line. >+ >+A I<$0> or I<$*> will always be replaced by the entire line, unless they >+have been escaped, regardless of the B<--awk-field-syntax> option. >+ >+An escaped I<$N>, I<$0> or I<$*> may have unwanted effects since the value >+will be determined by the shell used to execute the command. > > =item B<mail [addresses=address:address:...][,subject=your_text_here]> >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1622187
: 1478587