as a part of script I'm trying to copy a file from remote site. But got an error. To me that sounds bit strange as everything sounds ok:
#aaa="/path/to/some file with spaces(and brackets).txt"
....
#scp [email protected]:"$aaa" /test/
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `scp -f /path/to/some file with spaces.txt'
upd: problem with brackets...
set -x
in your script before the problem so the exact command be executed is printed out on the screen?aaa="'/path/to/some file with spaces(and brackets).txt'"
should escape it twice, once in single quotes, once in double quotes.