Here is the experiment I tried on Ubunu 14.04.
curl -X POST -d '<request>something<\request>' --header "Content-Type:application/xml" url
This command works on the terminal but it does not work as a MATLAB command using system(cmd) i.e.
cmd = 'curl -d ''<request>something<\request>'' url' ;
system(cmd)
here is the error message from MATLAB:
curl: /usr/local/MATLAB/R2013a/bin/glnxa64/libcurl.so.4:
no version information available (required by curl)
curl: (48) An unknown option was passed in to libcurl
:1: parser error : Document is empty
^-:1: parser error : Start tag expected, '<' not found ^
ans = 1
I do not have any libcurl.so files except under /usr/local/MATLAB/R2013a/bin/glnxa64/.
sroot#ubuntu14:~$ ls /usr/lib/libcu*
ls: cannot access /usr/lib/libcu*: No such file or directory
sroot#ubuntu14:~$ ls /usr/local/lib/libcu*
ls: cannot access /usr/local/lib/libcu*: No such file or directory
Regards,
On my Ubuntu, the libcurl*.so.* are here
> $ ls /usr/lib/x86_64-linux-gnu/libcurl*
> /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
> /usr/lib/x86_64-linux-gnu/libcurl-nss.so.4.2.0
> /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
> /usr/lib/x86_64-linux-gnu/libcurl.so.3
> /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0
> /usr/lib/x86_64-linux-gnu/libcurl.so.4
> /usr/lib/x86_64-linux-gnu/libcurl-nss.so.3
> /usr/lib/x86_64-linux-gnu/libcurl.so.4.2.0
> /usr/lib/x86_64-linux-gnu/libcurl-nss.so.4
And as for problem in calling curl from within matlab, you can redirect '/usr/local/MATLAB/R2013a/bin/glnxa64/libcurl.so.4' to '/usr/lib/x86_64-linux-gnu/libcurl.so.4'.
Related
I am trying to run this line on a linux machine:
curl --request GET \ --url 'https://www.tenable.com/downloads/api/v2/pages/nessus/files/Nessus-10.4.2-ubuntu1404_amd64.deb' \ --output 'nessus.deb'
but I am getting this error:
curl: (3) Host name ' --url' contains bad letter
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: " to save to a file.
I ended up using: wget https://www.tenable.com/downloads/api/v2/pages/nessus/files/Nessus-10.4.2-ubuntu1404_amd64.deb
but it seems I should not have done it this way because now the subsequent line I want to run isn't working: dpkg -i nessus.deb
The output for the curl was 'nessus.deb'. So to install you had to use 'dpkg -i nessus.deb'.
However, because you used wget, it did not create the output name, but just saved 'INSERTFILENAMEHERE'. So to install it, you would use:
'dpkg -i *INSERTFILENAMEHERE*'
For example, you would have put in
'wget https://www.tenable.com/downloads/api/v2/pages/nessus/files/Nessus-10.4.2-ubuntu1404_amd64.deb'
Then it would say something like
''Nessus.deb' saved'
So you would then put in.
'dpkg -i Nessus.deb'
And it would install the package. In short, the reason why the line was not working was because the file was there, but the name did not match.
I'm not so confident with Linux but, I've installed Armbian recently, and I can't make a script to run.
I have an Orange PI zero, the script that I found did run on Ubuntu server, so I'm fairly sure that that's not the problem. I need this script for restarting the router daily.
Note: I didn't wrote the script, I copied it from a forum that I don't remember now.
#!/bin/sh
echo "Get session key..."
SKEY=curl -s http://192.168.0.1/login.asp | perl -ne 'if(/var SessionKey = (\S+);/) {print
"$1\n";}' echo "Login... ($SKEY)" curl -X POST -d "loginUsername=admin&loginPassword=<PASSWORD GOES HERE>&loginOrInitDS=0"
http://192.168.0.1/goform/login?sessionKey=$SKEY echo "Get session new key..." SKEY=curl -s
http://192.168.0.1/RgSetup.asp | perl -ne 'if(/var SessionKey = (\S+);/) {print "$1\n";}' echo "Issue reboot...
($SKEY)" curl "http://192.168.0.1/goform/RgSetup?sessionKey=$SKEY" \
-H 'Referer: http://192.168.0.1/RgSetup.asp' \
--data 'WanLeaseAction=0&ApplyRgSetupAction=0&RebootAction=1' exit 1
I removed the password for this post, but that's not the problem. Anyways.
Here's the console:
root#orangepizero:~# ./router.sh
Get session key...
./router.sh: 3: ./router.sh: -s: not found
Can't open echo: No such file or directory.
Can't open Login... (): No such file or directory.
Can't open curl: No such file or directory.
Can't open -X: No such file or directory.
Can't open POST: No such file or directory.
Can't open -d: No such file or directory.
Can't open loginUsername=admin&loginPasswosmierd=<PASSWORD GOES HERE>&loginOrInitDS=0: No such file or directory.
./router.sh: 5: ./router.sh: http://192.168.0.1/goform/login?sessionKey=: not found
./router.sh: 6: ./router.sh: http://192.168.0.1/RgSetup.asp: not found
Can't open echo: No such file or directory.
Can't open Issue reboot...
(): No such file or directory.
Can't open curl: No such file or directory.
Can't open http://192.168.0.1/goform/RgSetup?sessionKey=: No such file or directory.
Can't open -H: No such file or directory.
Can't open Referer: http://192.168.0.1/RgSetup.asp: No such file or directory.
Can't open --data: No such file or directory.
Can't open WanLeaseAction=0&ApplyRgSetupAction=0&RebootAction=1: No such file or directory.
Can't open exit: No such file or directory.
Can't open 1: No such file or directory.
root#orangepizero:~#
I've tried:
chmod +x router.sh
apt-get upgrade
reinstalling curl
I think I'm missing some component, that would explain why did this run on Ubuntu server.
Thanks in advance!
d#Desktop /cygdrive/c/users/test/otherfolder
$ cygstart --action=runas ping -c 1 www.google.com | grep 'bytes from' | cut -d
= -f 4
Unable to start 'ping': The operating system denied access to the specified file
.
d#Desktop /cygdrive/c/users/test/otherfolder
$
I am trying to run some scripts on cygwin, but I can't get those script running for some reasons. I tried to run as administrator, I also tried using cygstart --action=runas, but nothing seems to work. Any idea?
chmod 755 ping to set the permissions of the file. Should work.
I am trying to recursively download files from a specific website and I am encountering an error I've never seen before and which google comes up blank on. The command I'm entering is:
wget -m -p -E -k -K -np http://www.slac.stanford.edu/~timb/500/1f_3f_production/ae_1f/E0500-TDR_ws.Pae_ea.Gwhizard-1.95.eB.pL.I37470/
and the output is:
Conversion from 'ANSI_X3.4-1968' to 'ANSI_X3.4-1968' isn't supported
zsh: segmentation fault (core dumped) wget -m -p -E -k -K -np
The error seems to occur no matter what arguments I use. More strangely, it has no problems if I download each file in the directory individually. Does anybody have an idea what this error means?
Your exact command works for me on Windows 7 CMD line. I get 9 files. Google reports some problems with zsh. Can you try bash?
When building gcc-4.8.1, I met a cp command as following:
#!/bin/sh
set -x
fname="cp.sh"
cp -v $fname.{,.bk}
It will occurs error when execute this script:
<29>pli[1050]#~/workspace/shell*0 > sh cp.sh
+ fname=cp.sh
+ cp -v cp.sh{,.bk}
cp: missing destination file operand after âcp.sh{,.bk}â
Try 'cp --help' for more information.
<30>pli[1051]#~/workspace/shell*0 >
But when type it on cmd line directly, it works well as expected. It is very in comprehensive to me.\n
<28>pli[1049]#~/workspace/shell*0 > cp -v cp.sh{,.bk}
cp.sh -> cp.sh.bk
<29>pli[1050]#~/workspace/shell*0 > ^C
You need to build gcc with "bash". On Ubuntu derived distributions "/bin/sh" in not linked to "/bin/bash" (but to "/bin/dash"); this is documented in the Ubuntu wiki here. I would suggest using a "ppa" if possible.