Skip to content

Commit 2acab98

Browse files
committed
Bugfix in sed's.
1 parent 08db087 commit 2acab98

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Welcome to the Python RPM Porting Guide
1313
=======================================
1414

15-
This document aims to guide you through the process of porting your Python 2 Fedora package to Python 3.
15+
This document aims to guide you through the process of porting your Python 2 RPM package to Python 3.
1616

1717
.. note::
1818
If you struggle with the porting of your package and would like help or more information, please contact us at the `python-devel mailing list`_ (also accessible through a `web interface`_) and we will try to help you and/or improve the guide accordingly.

subsections/h3-shebangs.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ To change the shebangs in the files you can use one (or a combination) of the fo
4242
.. code-block:: console
4343
4444
$ # Change shebang in individual files
45-
$ sed -i '1s_^#!/usr/bin/\(python\|env python\)_#!%{__python3}_' path/to/file1 file2 file3 ...
45+
$ sed -i '1s=^#!/usr/bin/\(python\|env python\)=#!%{__python3}=' path/to/file1 file2 file3 ...
4646
4747
$ # Change shebang in all relevant files in this directory and all subdirectories
48-
$ # See `man find` for how the `-exec command ;` syntax works
49-
$ find . -type f -exec sed -i '1s_^#!/usr/bin/\(python\|env python\)_#!%{__python3}_' {} \;
48+
$ # See `man find` for how the `-exec command {} +` syntax works
49+
$ find -type f -exec sed -i '1s=^#!/usr/bin/\(python\|env python\)=#!%{__python3}=' {} +
5050
5151
$ # Change shebang in all relevant executable files in this directory and all subdirectories
52-
$ find . -type f -executable -exec sed -i '1s_^#!/usr/bin/\(python\|env python\)_#!%{__python3}_' {} \;
52+
$ find -type f -executable -exec sed -i '1s=^#!/usr/bin/\(python\|env python\)=#!%{__python3}=' {} +
5353
5454
You don't have to worry about accidentally corrupting other files as these scripts will only change a file if the beginning of its first line exactly matches one of the two aforementioned shebangs.

0 commit comments

Comments
 (0)