Consider using { cmd1; cmd2; } >> file instead of individual redirects
24 echo "Turning Off - Static IP"
25
26 echo "# interfaces(5) file used by ifup(8) and ifdown(8)" > "${NETWORK}"
27 echo "# Include files from /etc/network/interfaces.d:" >> "${NETWORK}"28 echo "source-directory /etc/network/interface" >> "${NETWORK}"
29 echo "" >> "${NETWORK}"
30 echo "# Set static ip on ethernet interface of 192.168.3.100" >> "${NETWORK}"
Consider using { cmd1; cmd2; } >> file instead of individual redirects
6 echo "Turning On - Static IP"
7
8 echo "# interfaces(5) file used by ifup(8) and ifdown(8)" > "${NETWORK}"
9 echo "# Include files from /etc/network/interfaces.d:" >> "${NETWORK}"10 echo "source-directory /etc/network/interface" >> "${NETWORK}"
11 echo "" >> "${NETWORK}"
12 echo "# Set static ip on ethernet interface of 192.168.3.100" >> "${NETWORK}"
Consider using { cmd1; cmd2; } >> file instead of individual redirects
50
51 # Create Control File for Tensorflow.
52 echo "Package: tensorflow-mrdt" > /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_arm64/DEBIAN/control
53 echo "Version: ${TENSORFLOW_VERSION}" >> /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_arm64/DEBIAN/control 54 echo "Maintainer: google" >> /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_arm64/DEBIAN/control
55 echo "Depends:" >> /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_arm64/DEBIAN/control
56 echo "Architecture: arm64" >> /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_arm64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
51
52 # Create Control File for Tensorflow AMD64.
53 echo "Package: tensorflow-mrdt" > /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_amd64/DEBIAN/control
54 echo "Version: ${TENSORFLOW_VERSION}" >> /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_amd64/DEBIAN/control 55 echo "Maintainer: google" >> /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_amd64/DEBIAN/control
56 echo "Depends:" >> /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_amd64/DEBIAN/control
57 echo "Architecture: amd64" >> /tmp/pkg/tensorflow_${TENSORFLOW_VERSION}_amd64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
27
28 # Create Control File
29 echo "Package: quill-mrdt" > /tmp/pkg/quill_${QUILL_VERSION}_arm64/DEBIAN/control
30 echo "Version: ${QUILL_VERSION}" >> /tmp/pkg/quill_${QUILL_VERSION}_arm64/DEBIAN/control31 echo "Maintainer: odygrd" >> /tmp/pkg/quill_${QUILL_VERSION}_arm64/DEBIAN/control
32 echo "Depends:" >> /tmp/pkg/quill_${QUILL_VERSION}_arm64/DEBIAN/control
33 echo "Architecture: arm64" >> /tmp/pkg/quill_${QUILL_VERSION}_arm64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
27
28 # Create Control File
29 echo "Package: quill-mrdt" > /tmp/pkg/quill_${QUILL_VERSION}_amd64/DEBIAN/control
30 echo "Version: ${QUILL_VERSION}" >> /tmp/pkg/quill_${QUILL_VERSION}_amd64/DEBIAN/control31 echo "Maintainer: odygrd" >> /tmp/pkg/quill_${QUILL_VERSION}_amd64/DEBIAN/control
32 echo "Depends:" >> /tmp/pkg/quill_${QUILL_VERSION}_amd64/DEBIAN/control
33 echo "Architecture: amd64" >> /tmp/pkg/quill_${QUILL_VERSION}_amd64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
31
32 # Create Control File
33 echo "Package: pytorch-mrdt" > /tmp/pkg/pytorch_${TORCH_VERSION}_arm64/DEBIAN/control
34 echo "Version: ${TORCH_VERSION}" >> /tmp/pkg/pytorch_${TORCH_VERSION}_arm64/DEBIAN/control35 echo "Maintainer: pytorch" >> /tmp/pkg/pytorch_${TORCH_VERSION}_arm64/DEBIAN/control
36 echo "Depends:" >> /tmp/pkg/pytorch_${TORCH_VERSION}_arm64/DEBIAN/control
37 echo "Architecture: arm64" >> /tmp/pkg/pytorch_${TORCH_VERSION}_arm64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
28
29 # Create Control File
30 echo "Package: pytorch-mrdt" > /tmp/pkg/pytorch_${TORCH_VERSION}_amd64/DEBIAN/control
31 echo "Version: ${TORCH_VERSION}" >> /tmp/pkg/pytorch_${TORCH_VERSION}_amd64/DEBIAN/control32 echo "Maintainer: pytorch" >> /tmp/pkg/pytorch_${TORCH_VERSION}_amd64/DEBIAN/control
33 echo "Depends:" >> /tmp/pkg/pytorch_${TORCH_VERSION}_amd64/DEBIAN/control
34 echo "Architecture: amd64" >> /tmp/pkg/pytorch_${TORCH_VERSION}_amd64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
28
29 # Create Control File
30 echo "Package: opencv-mrdt" > /tmp/pkg/opencv_${OPENCV_VERSION}_arm64/DEBIAN/control
31 echo "Version: ${OPENCV_VERSION}" >> /tmp/pkg/opencv_${OPENCV_VERSION}_arm64/DEBIAN/control32 echo "Maintainer: OpenCV" >> /tmp/pkg/opencv_${OPENCV_VERSION}_arm64/DEBIAN/control
33 echo "Depends:" >> /tmp/pkg/opencv_${OPENCV_VERSION}_arm64/DEBIAN/control
34 echo "Architecture: arm64" >> /tmp/pkg/opencv_${OPENCV_VERSION}_arm64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
28
29 # Create Control File
30 echo "Package: opencv-mrdt" > /tmp/pkg/opencv_${OPENCV_VERSION}_amd64/DEBIAN/control
31 echo "Version: ${OPENCV_VERSION}" >> /tmp/pkg/opencv_${OPENCV_VERSION}_amd64/DEBIAN/control32 echo "Maintainer: OpenCV" >> /tmp/pkg/opencv_${OPENCV_VERSION}_amd64/DEBIAN/control
33 echo "Depends:" >> /tmp/pkg/opencv_${OPENCV_VERSION}_amd64/DEBIAN/control
34 echo "Architecture: amd64" >> /tmp/pkg/opencv_${OPENCV_VERSION}_amd64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
27
28 # Create Control File
29 echo "Package: googletest-mrdt" > /tmp/pkg/gtest_${GTEST_VERSION}_arm64/DEBIAN/control
30 echo "Version: ${GTEST_VERSION}" >> /tmp/pkg/gtest_${GTEST_VERSION}_arm64/DEBIAN/control31 echo "Maintainer: Google" >> /tmp/pkg/gtest_${GTEST_VERSION}_arm64/DEBIAN/control
32 echo "Depends:" >> /tmp/pkg/gtest_${GTEST_VERSION}_arm64/DEBIAN/control
33 echo "Architecture: arm64" >> /tmp/pkg/gtest_${GTEST_VERSION}_arm64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
27
28 # Create Control File
29 echo "Package: googletest-mrdt" > /tmp/pkg/gtest_${GTEST_VERSION}_amd64/DEBIAN/control
30 echo "Version: ${GTEST_VERSION}" >> /tmp/pkg/gtest_${GTEST_VERSION}_amd64/DEBIAN/control31 echo "Maintainer: Google" >> /tmp/pkg/gtest_${GTEST_VERSION}_amd64/DEBIAN/control
32 echo "Depends:" >> /tmp/pkg/gtest_${GTEST_VERSION}_amd64/DEBIAN/control
33 echo "Architecture: amd64" >> /tmp/pkg/gtest_${GTEST_VERSION}_amd64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
27
28 # Create Control File
29 echo "Package: geographiclib-mrdt" > /tmp/pkg/geolib_${GEOLIB_VERSION}_arm64/DEBIAN/control
30 echo "Version: ${GEOLIB_VERSION}" >> /tmp/pkg/geolib_${GEOLIB_VERSION}_arm64/DEBIAN/control31 echo "Maintainer: GeographicLib" >> /tmp/pkg/geolib_${GEOLIB_VERSION}_arm64/DEBIAN/control
32 echo "Depends:" >> /tmp/pkg/geolib_${GEOLIB_VERSION}_arm64/DEBIAN/control
33 echo "Architecture: arm64" >> /tmp/pkg/geolib_${GEOLIB_VERSION}_arm64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
27
28 # Create Control File
29 echo "Package: geographiclib-mrdt" > /tmp/pkg/geolib_${GEOLIB_VERSION}_amd64/DEBIAN/control
30 echo "Version: ${GEOLIB_VERSION}" >> /tmp/pkg/geolib_${GEOLIB_VERSION}_amd64/DEBIAN/control31 echo "Maintainer: GeographicLib" >> /tmp/pkg/geolib_${GEOLIB_VERSION}_amd64/DEBIAN/control
32 echo "Depends:" >> /tmp/pkg/geolib_${GEOLIB_VERSION}_amd64/DEBIAN/control
33 echo "Architecture: amd64" >> /tmp/pkg/geolib_${GEOLIB_VERSION}_amd64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
27
28 # Create Control File
29 echo "Package: abseil-mrdt" > /tmp/pkg/abseil_${ABSEIL_VERSION}_arm64/DEBIAN/control
30 echo "Version: ${ABSEIL_VERSION}" >> /tmp/pkg/abseil_${ABSEIL_VERSION}_arm64/DEBIAN/control31 echo "Maintainer: abseil" >> /tmp/pkg/abseil_${ABSEIL_VERSION}_arm64/DEBIAN/control
32 echo "Depends:" >> /tmp/pkg/abseil_${ABSEIL_VERSION}_arm64/DEBIAN/control
33 echo "Architecture: arm64" >> /tmp/pkg/abseil_${ABSEIL_VERSION}_arm64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
27
28 # Create Control File
29 echo "Package: abseil-mrdt" > /tmp/pkg/abseil_${ABSEIL_VERSION}_amd64/DEBIAN/control
30 echo "Version: ${ABSEIL_VERSION}" >> /tmp/pkg/abseil_${ABSEIL_VERSION}_amd64/DEBIAN/control31 echo "Maintainer: abseil" >> /tmp/pkg/abseil_${ABSEIL_VERSION}_amd64/DEBIAN/control
32 echo "Depends:" >> /tmp/pkg/abseil_${ABSEIL_VERSION}_amd64/DEBIAN/control
33 echo "Architecture: amd64" >> /tmp/pkg/abseil_${ABSEIL_VERSION}_amd64/DEBIAN/control
Consider using { cmd1; cmd2; } >> file instead of individual redirects
82 # Write the comment to a new text file in the comments directory
83 output_file="comments/$comment_counter.txt"
84 echo "File: $current_file" > "$output_file"
85 echo "Start Line: $start_line" >> "$output_file"86 echo "End Line: $end_line" >> "$output_file"
87 echo "Commit Hash: $commit_id" >> "$output_file"
88 echo "Comment:" >> "$output_file"
Consider using { cmd1; cmd2; } >> file instead of individual redirects
65 # Write the comment to a new text file in the comments directory
66 output_file="comments/$comment_counter.txt"
67 echo "File: $current_file" > "$output_file"
68 echo "Start Line: $start_line" >> "$output_file"69 echo "End Line: $end_line" >> "$output_file"
70 echo "Commit Hash: $commit_id" >> "$output_file"
71 echo "Comment:" >> "$output_file"
Description
Rather than adding >> something
after every single line, you can simply group the relevant commands and redirect the group. Now the file has to be opened and closed only once, which can be a performance gain.
Bad Practice
echo foo >> file
date >> file
cat stuff >> file
Recommended:
{
echo foo
date
cat stuff
} >> file