Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

put url in script

Status
Not open for further replies.

Igaduma

Technical User
Nov 23, 2001
322
BE
Hi all,

I don't know too much about scripting, only the basisc really.
We've got internally a short message server which forwards any test message thrown at it.

Using this in combination with scripts I could get the machines to forward me stats & such on my mobile.
Not really a must-have but surely a nice-to-have...

But, I have no idea how I can get a simple script to do an "openURL" command.

It works when I call

#netscape -remote openURL'heregoesurl'

But I would like to just fire it out from inside the script.

This is the url:

Everything is parsed on 1 line.

Thanks for any help!
 
Hi there,

I searched after posting...maybe next time I should do it the other way round...

Anyway, I found cURL on the net, which does exactly what I need.

wget should be something similar,

another thing....

how can I store the output of /usr/bin/uptime in a variable in a script and call it somewhere else ?

thanks!


 
[tt]UPTIME=`/usr/bin/uptime`
echo "The uptime output was ${UPTIME}"[/tt]

Is that what you mean? Annihilannic.
 
In a way yeah,

But it returns here:

the uptime output was /usr/bin/uptime

I would think it would put the actual *output* of the command instead of the command location no ?
 
Oh, the quotes I used are backquotes (probably not very easy to see). Usually the top left key on the keyboard-proper... i.e. under Esc.

Alternatively, if you're using Korn shell you could use:

[tt]UPTIME=$(/usr/bin/uptime)[/tt] Annihilannic.
 
Hi Annihilannic,

it works!
Perfect...

Now another one...how to swap in a text string the ascii spaces with a + sign ?


Thanks for the great help already !!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top