Register
It is currently Thu Oct 30, 2014 11:40 am

Variable concatentation


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Fri May 16, 2014 1:15 pm   

Joined: Fri May 16, 2014 1:06 pm
Posts: 2
All,

Sorry for the basic question. I've tried lots of combinations to fix this but not succeed.

The code extract is as follows.

Code:
SVNcommand="http://10.1.1.1/svn/Warwick/Ecom/Sites/Tags/""${line}"
  SVNcommand="homepw${SVNcommand}pwhome"

echo  "${SVNcommand}"

#svn export --force "${SVNcommand}"


The output is pwhomehttp://10.1.1.1/svn/Warwick/Ecom/Sites/Tags/Stagingtest2

The things I don't understand are as follows:

1. Why is "pwhome" at the start of the output?
2. Why is "homepw" not in the output

What I am actually trying to do is do an svn export of a url which contains the ${line} variable to a fixed folder. If I include it all in the svn export (e.g. svn export http://10.1.1.1/svn/Warwick/Ecom/Sites/Tags/${line} /export/directory it complains that it's not a properly formatted uri.

Thanks

Andrew


Top
 Profile  
 PostPosted: Fri May 16, 2014 2:51 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 550
hi,

I can't reproduce this behaviour :
Code:
$ line=abc
$ SVNcommand="http://10.1.1.1/svn/Warwick/Ecom/Sites/Tags/$line"
$ SVNcommand="homepw${SVNcommand}pwhome"
$ echo "$SVNcommand"
homepwhttp://10.1.1.1/svn/Warwick/Ecom/Sites/Tags/abcpwhome
where does `line` come from ?


Top
 Profile  
 PostPosted: Sun May 18, 2014 4:00 am   

Joined: Fri May 16, 2014 1:06 pm
Posts: 2
Thank you for your help.

line is coming from a text file and it was a problem with the eol characters in that file. Sorry, as I'm new to bash, I assumed it was a fault in my script.

Thanks


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 30 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP