I have the following bash script, it is running in a file named some_file.sh, the contents look like
sudo -i -u $USER bash << EOF
func(){
echo $1
}
func 'Test message for channel'
EOF
This returns nothing in the argument for the function even though the function is invoked with an argument, what am I doing wrong?
To invoke it I do
bash some_file.sh