I am writing a script and I noticed that a certain line of code is constantly being reused.
So I thought why not put it into a variable for ease of use, and when something changes, I only need to change it in one location.
When I do this:
scriptpath="echo -e "\n" && curl -s -u lalala:hihihi ftp://ftp.somewhere.com/folder"
and then use the variable as following:
$SCRIPTPATH/some_script.sh | bash
I get the following error message:
bash: line 2: $'\n': command not found