New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

OS 10.5 - [BASH] 2 echo on a single line


Post Reply New Thread Subscribe

 
Thread Tools
dedis

 
Member Since: Jun 20, 2008
Posts: 1
dedis is on a distinguished road

dedis is offline
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.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,620
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
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$

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks

Post Reply New Thread Subscribe


« Would it benefit me to switch to 10.5 on my G4 PowerBook? | Recovering e-mails from deleted accounts »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
iPhone In Line Now Thread xtophercaa iPhone Hardware and Accessories 39 07-03-2007 05:37 PM
CSS margin only applies to first line? Morgan19 Web Design and Hosting 4 12-20-2005 12:13 PM

All times are GMT -4. The time now is 06:51 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?