[BASH] 2 echo on a single line

Joined
Jun 20, 2008
Messages
1
Reaction score
0
Points
1
Hi there!

I'm new on Mac.

I'm trying to make a little bash script on my mac; but it seems to do not work exactly as linux do.

I try to print on stdout an url with two variable:

URL=http://www.blabla.com
GET=?toto1&toto2

So write:

Code:
echo $URL$TOTO

The problem is that $TOTO is written at the begining of the line, so it give me:

?toto1&toto2labla.com

...

How can I use echo in bash to get:

http://www.blabla.com?toto1&toto2

Please, answer before i Throw by the windows my new mac book to go back to my old computer on Linux :'(


PS: sorry if my english is bad.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
works if I define the variables as such.

#!/bin/sh
URL="http://www.blabla.com"
GET="?toto1&toto2"
echo $URL$GET


mikeMbp:scripts mike$ ./url
http://www.blabla.com?toto1&toto2
mikeMbp:scripts mike$
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top