Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I go to visit this url

https://github.com/search?q=jquery+stars%3A>10+forks%3A<10&type=Repositories

using this command for lynx:

lynx -accept_all_cookies https://github.com/search?q=jquery+stars%3A>10+forks%3A<10&type=Repositories

First I get a code like this -> [1] 4324 then another line which says -> bash: 10: No such file or directory

So, question is how can I browse this url url lynx? Also I can not curl this url , curl also showing nearly like same.

I am using ubuntu 12.04 LTS

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The problem is that your URL contains special characters that are being interpreted by the shell because you are not quoting it. So, short answer, use quotes:

lynx -accept_all_cookies 'https://github.com/search?q=jquery+stars%3A>10+forks%3A<10&type=Repositories'

Long answer: The specific issues here are >10 and &. The & sends a job to the background:

$ sleep 5 &
[1] 2015

Note that the above causes a similar message to appear, the number in brackets is the job ID, in this case 1 since it is the only job running in the background and the other number is the process ID (PID) of the backgrounded process.

The next issue is the <10 which means "read input from the file called '10' and >10 which the shell interprets as "redirect output to a file called '10'`. For example:

$ echo "Hello" > 10
$ cat 10
Hello

All of these issues can be avoided if you simply quote such things, quoting will protect special characters from being interpreted by the shell.

share|improve this answer
    
It works! Thanks for your excellent explanation! –  Tamim Ibrahim Apr 14 at 16:56

Bash is interpreting the URL. The < and & mean things to it so they're being ripped around and aren't being passed to lynx.

The simple answer is to quote the url:

lynx -accept_all_cookies 'https://github.com/search?q=jquery+stars%3A>10+forks%3A<10&type=Repositories'

I'm using single quotes here so that even $ isn't interpreted.

share|improve this answer
    
Thank you, now it's working! I am new in ubuntu, just learned a new things very useful from you. –  Tamim Ibrahim Apr 14 at 16:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.