I have the following command that is run at the command line of a linux box:
new.sh import -m "testing of Subversion" /local/idnow/perl/ldap htp://test.com
(Note the original URL is blocked.) Here, new.sh is simply a wrapper script for the svn (subversion) program. In my bash script, I am doing various things with the arguments, but in the end, I want to rerun the command replacing "new.sh" with svn. In other words:
svn import -m "testing of Subversion" /local/idnow/perl/ldap htp://test.com
the problem is that I am getting this error on the "svn" line:
svn: Try 'svn help' for more info
svn: Too many arguments to import command
However, when I run the "svn" command directly at the command line (ie, by me typing it in, and not the bash script), the command works perfectly. So the problem does not lie in the arguments. I believe the problem lies with how I am recreating the command line.
I cannot simple run the command using the following: svn $@. The reason is that the quotations are removed and svn complains. makes sense to me. So I manipulated the quoted section adding \" before and after it. From that I can tell, that is the problem. Here is the section when I add the quotations into the original command line:
for i in "$@"
if [[ $i =~ $whitespace ]]
i=\"$i\" # adding the quotation marks for later use
cLine="$cLine $i" #both of these statements reconstruct the original command line
When I am finally ready to run the subversion command, I simply do this:
And that is where I get the error.
Any ideas on what I am doing wrong? Hopefully, there is a way to do what i want to do.