Page 1 of 1

URL, shell(curl), Why is LC so frustrating?

Posted: Wed Aug 13, 2014 2:08 am
by rrBUSS9EE
So I want to get the contents of a URL during openStack, but it returns empty.

Now I remember something from years ago that there is an issue with when LC's internet library loads and that you have to do something or other, or wait for some point, or jump through some other hoops before you can call this function... but can't remember it, and couldn't find reference to it via search so I move on. So I'll use the shell function and curl.

'curl http://blahBlahBlah/myfile.txt' in bash shell returns:

123416
123429

But:
get "curl http://blahBlahBlah/myfile.txt"
get shell(it)

returns:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 13 100 13 0 0 28 0 --:--:-- --:--:-- --:--:-- 28
123416
123429


WTF!

Re: URL, shell(curl), Why is LC so frustrating?

Posted: Wed Aug 13, 2014 6:10 am
by Thierry
rrBUSS9EE wrote: 'curl http://blahBlahBlah/myfile.txt' in bash shell returns:

get "curl http://blahBlahBlah/myfile.txt"
get shell(it)
You could try curl silent mode;

From memory, it should be -s, but check the man pages if it doesn't work.

The difference calling curl from shell and lc is there should be a curl config file
which the shell might read (depends on your OS, version,...) but not lc.

HTH,

Thierry

Re: URL, shell(curl), Why is LC so frustrating?

Posted: Fri Oct 03, 2014 7:28 pm
by sturgis
Seems that openstack should work, but I guess its possible the library still isn't loaded. Might try using opencard (fires later) and/or using a send in time to do the work. I assume you can get it to work after complete load?

Might also look at the contents of "the result" after the command.

Re: URL, shell(curl), Why is LC so frustrating?

Posted: Sun Oct 05, 2014 1:59 am
by mwieder
Also, since curl acts a bit differently on linux and osx, at least with respect to client certificates, I use wget instead of curl. There are options to return just the data, not any of the statistics. From memory they're

-O- -o /dev/null

Shelling out to curl or wget or httpie should be completely independent of the libURL library, so when it loads shouldn't be a problem.