Hey folks, I am currently developing on my own bash script and would like to extend it with a function where code that I already have will be placed into a second bash file without being executed. The whole thing looks somewhat like this:
#!/bin/bash
echo "Hey, I am the main script!"
...
cat > /home/$USER/bin/SECOND_SCRIPT << EOT
#!/bin/bash
# - This shall be the second script which automaticall gets placed elsewhere
# - This shall not be executed when executing the main script
# - Code within this script shall not appear within the terminal of the main script
# Settings
LOCALMUSIC="$HOME/Music"
ALERT="/usr/share/sounds/pop.wav"
PLAYER="mpv --vo null"
(more lines of code here)
EOT
# Continuing with stuff of the main script
...
My main Issue with creating this neat piece of my script is that code from the second script gets displayed and executed within the terminal window of the first main script. So, how would YOU accomplish this task? Is there some code snipped I missed to insert?