New answers tagged

0

When I'm confronted with needle-in-haystack work like this, I like to turn it into a line-oriented problem if I can. You might be able to do that with something like this: $ sed -E 's:[0-9]+:\n&\n:g' filename \ | grep -F -A1 '/pbs.twimg.com\/profile_images\' | tail -1 That puts any digit-string a line by itself, greps for your string, and prints the ...


0

Your output contains any amount of random cruft, and one line you are interested in. Select that line, discard anything but the ID and print the result: sed -n '/profile_images/s/.*profile_images\\\/\([0-9]\+\).*/\1/p' This could be made slightly more efficient by quitting immediately after that line has been processed. In fact, that is pretty much ...


0

I wouldn't use in documentation, nor 'in anger', but if you really want tilde you can do either of VAR=~/.vimrc; wget ... --output-document="$VAR" unset VAR # to keep things tidy # or put in ( subshell ) to keep pre-existing VAR # quotes only needed if $HOME (or anything you substitute for .vimrc) # can contain whitespace or glob characters ?*[ which is ...


4

Tilde expansion only works in the beginning of a word. (At least in bash, see e.g. https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html ) You could use, say --something=$HOME/filename if you only need to refer to the current user's home directory. Since --output-document takes a mandatory argument, writing the argument in a separate ...


1

As far as I know the '=' shouldn't be there... wget --option-document ~/.vimrc


1

The default recursion depth limit in wget is 5. This is primarily meant for the web where a large recursion is often a mistake, but the default also applies to FTP. Large recursion could also be a problem with FTP if the server has upward-pointing symbolic links. To make a complete mirror, pass -l -1 to make the recursion unlimited, or better, pass the ...


0

Running with -d shows what's going on: Location: http://blogs.gamefilia.com/lord-areg [following] .... Deciding whether to enqueue "http://blogs.gamefilia.com/lord-areg". Going to "" would escape "lord-areg" with no_parent on. Decided NOT to load it. Redirection "http://blogs.gamefilia.com/lord-areg" failed the test. The redirected page was outside ...


0

To diagnose this problem, try running the following command as root: pacman -S gdb && gdb wget Look for any language indicating that there is an error in the output.


4

One aspect of your problem is that you should use quotation mark to avoid having problems with the shell commands like &. But this is not the only problem. Many websites refuse to serve you if you are using a bot or program like wget. So you have to change the user agent. Go to: http://www.whatsmyua.com/ This website shows the usergent of your browser ...


5

When you run this command: wget https://translate.google.hu/?hl=hu&tab=wT#en/hu/Enthusiast what really happens is: you run wget with URL of "https://translate.google.hu/?hl=hu"; ampersand means that wget will run in background; a variable named tab is defined and gets a value wT#en/hu/Enthusiast. The reason for all this is that shell reserves some ...



Top 50 recent answers are included