В чем проблема?
Вам нужно использовать двойные кавычки.
Shellcheck проанализирует ваш скрипт и найдет ошибки:
$ shellcheck myscript Line 1: random="$(cat something.txt)" ^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang. Line 3: url="$(curl -i -L -X POST --cookie 'info=$3' \ ^-- SC2034: url appears unused. Verify use (or export if used externally). ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that. Line 4: -F 'var=$2' \ ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that. Line 6: -F 'file[]=@$1' \ ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that. Line 7: https://example.com/upload?id=$)" ^-- SC2086: Double quote to prevent globbing and word splitting. $