When I try to use a file name in a variable for the
cs add command, I cannot understand what happens. I'm using a bash script
myscript.sh which returns the path name of cscope database (
/mydir/cscope.out) based on the current file name (
:let db = system("myscript.sh " . expand("%:p"))
After that, when I call:
:cs add db
"E563: stat(/mydir/db) error 2"
When I call:
:exe "cs add " . db
"E563: stat(/mydir/cscope.out^@) error 2"
/mydir/cscope.out is the right file name which returned by
myscript.sh, but where the
^@ thing comes from? How do I correctly use the variable with a parameter in this case?
cs add is called with plain file name:
:cs add /mydir/cscope.out
Connection is created OK and no errors is reported.
/mydir/cscope.out Press ENTER or type command to continue