Ubuntu Networking :: Bash Command Equivalent To Cygwin "curl"?
May 27, 2010
I have a Cygwin script that connects to a web site with the bash command "curl". Phasing out Windows, I need to port everything to Linux. Ubuntu bash doesn't recognize "curl". There has got to be an equivalent.What would it be? Beneath the dashed line the top of the cygwin man page. And while on the topic of the bash commands available on Ubuntu, where could I find an exhaustive list?
I have a program that is completed under Linux, it requires library tidy, PCRE and libcurl, which could be found in Cygwin too.
I could compile my linux program through Cygwin and produce an EXE file, however it do require 'cygwin.dll' installed by the users.
I am wondering if I could have someway to produce out a stand-alone EXE file that could run independently from Cygwin ? ( I don't mind to combine that cygwin.dll and the EXE together for a larger EXE file).
I have installed cygwin 1.7.5. But the command "file" (check the type of a file) is missing. I tried to re-install, but could not find it on installation program. Where is it?
But I just downloaded cygwin to my xp machine. Tried my first experimental script and created it one level directly below where cygwin put me by default. The script, named show two says:
#!/bin/bash echo $1 echo $2
But bash apparently can't find it. The name of the script is showtwo, but I also tried naming it showtwo.sh; no dice.
I have installed cygwin to my windows xp machine. I typed the commmand in cygwin shell it shows "command not found". How can i install make command in cygwin
Based on previous forum discussions, I tried to install cygwin with 'make' installed from develop during installation. I can even see 'make.exe' in bin folder, but still while running the make command, it still shows error.
I was confused in one other part. Should I put the bin folder in some specific location or just wherever it is placed during cygwin installation? I was running VIC model, do I need to place the bin folder inside VIC source code folder.
Is there any curl API to configure only the required protocol. If I have proper openssl installed, the installed curl will have all the protocols (like HTTP, HTTPS, FTP, File etc...) supported by default. Is there any way to allow or disallow only some of the protocol at the runtime. Say I need to support only HTTPS, FILE and I dont want to allow HTTP. Is there any way to do this?
I'm on Ubuntu 11.04. I have read around about how to use curl to download a list of URLs from a text file, and everyone says to use
Code: curl -K URLlist.txt This is what the curl man page says as well. However, for even a simple file with one URL, this command outputs a bunch of weird symbols for me instead of downloading the file. For example, I have a text file "test.txt" with one line in the following format:
Code: url = "http://www.example.com/image.jpg" I use the curl command to download this file:
I have two suse linux server. Recently we got the license key. In one server I could able to register successfully. Another server is throwing an error. I am using yast-software- Novel customer center configuration. After selecting configure now, I am getting error has follows Execute curl command failed with 7 curl: (7) could't connect to host.
I need to download a file from a website which has a URL formatted like:
[URL]
This redirects to a .zip file which has to be saved. There is also a need to authenticate based on username and password.
I tried to use wget, curl and lynx with no luck.
UPDATE:
wget doesnt work with redirection. It simply downloads the webpage instead of the zip file. curl gives the error "Maximum redirection exceeded > 50 " lynx also gives the same error.
I'm on Ubuntu 11.04. I have read around about how to use curl to download a list of URLs from a text file, and everyone says to use Code:curl -K URLlist.txt. This is what the curl man page says as well. However, for even a simple file with one URL, this command outputs a bunch of weird symbols for me instead of downloading the file.For example, I have a text file "test.txt" with one line in the following format:
Code: url = "http://www.example.com/image.jpg" I use the curl command to download this file:
I am trying to connect to the web interface found at [URL] using curl. This first requires login information to be entered at [URL], but I am having an issue with the login process. I am trying to submit the following form via POST:
Code: <form action="j_security_check" method="post" id="login_form" name="login_form"> <center> <table style="background: #cac1cf;FONT-SIZE: 12px;"> <tr> <td align="center" colspan="2">Please enter your username and password:</td> </tr> <tr> <td align="right">Username</td> <td> <input name="j_username" style="width: 250px" id="j_username" type="text"/> </td> </tr> <tr> <td align="right">Password</td> <td> <input style="width: 250px" name="j_password" id="j_password" type="password"/> </td> </tr> <tr> <td colspan="2" align="center"> <input value="Enter" name="enter" type="submit"/> <input value="Clear" name="Clear" type="reset"/> </td> </tr> </table> </center> </form> The command that I am using for this is the following:
Code: curl -c cookies -b cookies -L -d "j_username=user%40domain.com&j_password=pass" [URL] The command is properly formatted as far as I can tell. I tested it with another website using a similar authentication scheme using different POST variables specific to the form and it worked fine.
When I run the above command with the -v tag, it reveals this: Code: * Connected to lcl.uniroma1.it (151.100.4.74) port 80 (#0) > POST /sso/j_security_check HTTP/1.1 > User-Agent: curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18 > Host: lcl.uniroma1.it > Accept: */* > Content-Length: 44 > Content-Type: application/x-www-form-urlencoded > } [data not shown] < HTTP/1.1 408 The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser < Date: Sat, 29 Jan 2011 15:26:41 GMT < Server: Apache-Coyote/1.1 < Content-Type: text/html;charset=utf-8 < Content-Length: 1554 < Connection: close < { [data not shown] 103 1554 100 1554 0 52 5081 170 --:--:-- --:--:-- --:--:-- 10223* Closing connection #0
I cannot tell why the login timeout is expired when I try to do this, and my investigation toward this end has been fruitless. I saw a brief snippet on Google that vaguely suggested that the underscores in the domain name were at fault, but replacing these with their encoded counterparts did nothing to resolve the issue (that, and underscores should be fine when sent unencoded according to the standards). I have extensively perused the man pages and have come up with nothing to adequately explain this behavior. I also talked to a friend who has worked with curl in his line of work, but he mostly has experience in the context of PHP and has not dealt with this issue before. I am running GNU/Linux 2.6.35-22-generic-pae.
i'm trying to write a bash script to upload an image to [URL], but i can't get i working properly. Everytime i try, the html returns me a error saying "Upload is disabled during short maintenance work (ETA 10 minutes). Brb!", while from the browser everything works fine. This is my current command line:
Code: curl -L -b cookie-pix.txt -c newcookie.txt www.pixhost.org/cover-upload -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" -F 0=@/home/admin/Desktop/karm.jpg -F content_type=0 -F press=Upload And this is the html of the form:
I have a DBA that needs to be able to do a "setgroups" on Linux. He had the functionality on AIX but now we're migrating to red hat. In-case you don't know the setgroups command in AIX; it allows users to drop groups that they belong to for that login session. He wants to be able to do this so that he can drops groups for testing. Does anyone know of any equivalent commands to setgroups or another way of dropping groups for that session and not permanently?
Is there an equivalent command that will perform the same task as ALT+F4 keystroke? I want to create a simple script that lirc can use so I can set up a button on my remote to close program windows that pop up (like when plugging in usb thumb drives, inserting a dvd, and other windows), and avoid having to remote desktop or go into CLI to kill the window.
im switching over from ubuntu and just have a couple questions, what is fedoras equivalent commands to the apt-get command? and what other slight variants am i going to need to know?
If I want to use the locate command on a Linux machine, I usually run sudo updatedb first to update the database. I can run the locate command on OS X 10.5 but I can't find updatedb. What's the corresponding updatedb for the mac?
In solaris we have ndd , tip and ptree command but I couldnt find any similar command in Linux. does anyone knows the equivalent for ndd ptree tip then please let me know.
We often require to find an equivalent text command for any GUI operation. Just as an example we click on a folder (say ABC) from the current directory in order to see the contents of that directory. The equivalent command for it to happen would be->
Code: cd ABC ls Now the thing is that we often don't know what that equivalent command will be. So I want to know that is there any way out to find it. What I want to do is that I shall perform any operation using mouse in the GUI mode(whatever operation it could be) and then I can see a log file to see what I actually did last(rather what the command would have been if I have worked in the text mode)...
I am teaching using an Ubuntu 10 server. The course stipulates the students use the mail command to send me assessment work, however I can't get mail to work (I did have to install it in the first place). After I end the message with a dot I get the message "send-mail: cannot open mail:25".
What is the equivalent of read -r (solaris command ) in Linux ? read utility in solaris will read a single line from standard input and -r option is used not to treat backslash () as an escape character .
title's confusing, but can't edit it. I may not know what I'm talking about, but does anyone want to have a go at translating this suggestion I dug up into one that Mint 7 would act on?
Using the following command: xterm -e tail -f stdout.log
I can see the log of an applications and it's update in realtime. I want to uninstall the gnome and I'm looking for the equivalent command for the terminal. I want on startup tty4 for example to show me the log.
I write a script to read a file which is something like a pipe (or) queue , which shows the running status.In normal case, if i open this file with cat command, i have to use ctrl+c to exit this . What command shall i use to do the same inside a shell script ? I have tried ^C in my script , but it does not exit the process.