Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hiddenpremise

macrumors regular
Original poster
I am trying to take my computer's name and pass it in the query line of a url. So far I can get the computer name, but I can't get the URL to assign to a variable.
This is what I wrote
Code:
BASEURL="http://isis/db.php?compname="
COMPNAME= /usr/sbin/networksetup -getcomputername
FINAL= ${BASEURL}${COMPNAME}
curl $FINAL

This is the output I get
Code:
testdb.sh: line 4: http://isis/db.php?compname=: No such file or directory

Any ideas?
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
COMPNAME=`/usr/sbin/networksetup -getcomputername`

Those are backticks. On a US keyboard this shared the ~ key next to the 1 key.

-Lee

EDIT: Not sure if this will fix the error you are getting, though...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.