I has a script that is going to run some bash commands if certain criteria are met. Consider the following example i just made up on the fly because i don't have my original script on this pc:
#/bin/bash
Go=$1
list="/etc/list.txt"
if [ "Go" == "' ]
then
echo "provide arbitrary arg, lulz..."
else
`cat $list | xargs curl "custom: arg1 arg2 arg3 | printf /n`
fi
# In my original script i have a some more code here which is important as you'll read shortly.
Ok see the part where i am telling bash to run shell commands? Contents of list.txt should be passed to curl via xargs, however the curl argument "custom: is
essential to the proper way in which i intend to use curl to retrieve the data i want.However this is where a problem arises, backticks tell bash to treat what ever is inbetween them as shell commands as you may know. However the quotation marks are problematic since they escape the backticked area of the code. If i don't add another quotation mark just before the end backtick the rest of the script is treated by bash as if it were shell commands which breaks the script but if i keep the quotation mark at the end curl might not do what i want.
Also printf /n prints a new line right? I am never sure. Lel.
So... wut do?