Skip to content

Commit 5795a76

Browse files
committed
Fixed sed commands to allow for options after shebangs.
1 parent 7bb6d73 commit 5795a76

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

subsections/h3-prep.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ To change the shebangs in the files you can use one (or a combination) of the fo
3232
.. code-block:: console
3333

3434
# Change shebang in individual files
35-
sed -i '1s_^#!/usr/bin/\(python\|env python\)$_#!/usr/bin/python3_' path/to/file1 file2 file3 ...
35+
sed -i '1s_^#!/usr/bin/\(python\|env python\)_#!/usr/bin/python3_' path/to/file1 file2 file3 ...
3636

3737
# Change shebang in all files in this directory and all subdirectories
3838
# See `man find` for how the `-exec command ;` syntax works
39-
find . -type f -exec sed -i '1s_^#!/usr/bin/\(python\|env python\)$_#!/usr/bin/python3_' {} \;
39+
find . -type f -exec sed -i '1s_^#!/usr/bin/\(python\|env python\)_#!/usr/bin/python3_' {} \;
4040

4141
# Change shebang in all executable files in this directory and all subdirectories
42-
find . -type f -executable -exec sed -i '1s_^#!/usr/bin/\(python\|env python\)$_#!/usr/bin/python3_' {} \;
42+
find . -type f -executable -exec sed -i '1s_^#!/usr/bin/\(python\|env python\)_#!/usr/bin/python3_' {} \;
4343

44-
You don't have to worry about accidentally corrupting other files as these scripts will only change a file if its first line exactly matches one of the two aforementioned shebangs.
44+
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.
4545
4646
Autodetection of Runtime Dependencies
4747
+++++++++++++++++++++++++++++++++++++

0 commit comments

Comments
 (0)