New answers tagged

0

You're seeing a write error 23 Write error. Curl couldn't write data to a local filesystem or similar. could you check the write perms on the dir ?


1

put the following lines into a script file, such ad mydownload.sh magnet=$(lynx -dump -hiddenlinks=listonly lynx_bookmarks.html | grep "magnet" | sed 's/&.*//' | cut -c 7-) curl http://my_ip:my_port_number/startdownload/${magnet} save and exit chmod 755 mydownload.sh ./mydownload.sh


1

So what you need is to capture the output of one command, and use it in another. The bash $(..) syntax will let you execute a command and capture the output, then you can use that output in another command. One way is to capture the output in a variable, such as: shortcut=$(lynx -dump -hiddenlinks=listonly lynx_bookmarks.html | grep magnet | sed ...


0

bash-4.1$ echo $( echo hi ) hi bash-4.1$ So, curl $( ... ) Would pass the output of whatever ... is to curl by running whatever those commands are as a subshell. $() can also be written with backticks, though those are header to read, and do not nest. grep | sed can probably be replaced with a single call to awk.


1

wget -r -nd -A jpg --accept-regex "https://alwaysSamePart.com/.*.jpg" https://whatever_domain.com -r allows to go recursively through website (you can specify -l to limit depth) -nd prevents directories creation -A limits download files to jpg images only --accept-regex limits images to needed pattern only


0

did you try -A or equivalent --accept options as given below ? wget "https://alwaysSamePart.com/" -A "*.jpg"


2

curl prints its status to stderr rather than stdout. To capture stderr in the same file, you need to redirect stderr to stdout by adding 2>&1 AFTER your stdout redirection: curl -T /home/pi/fb/$DATE.jpg ftp://myftpserver --user myuser:mypass >> /home/pi/fb/log.txt 2>&1 For a thought-provoking question that will help you understand ...


0

You are probably seeing output for standard error (stderr) which is a separate stream from standard out (stdout). It can be redirected with 2>&1 after the output destination. For Example: $ curl -T /home/pi/fb/$DATE.jpg ftp://myftpserver --user myuser:mypass >> /home/pi/fb/log.txt 2>&1


1

AFAIK, the "curl" command does not provide a feature for determining if the connection is ssl or not. So you need to use a different tool for checking this. I've created a small script, which uses "openssl" to determine if the connection specified is ssl or not. Enjoy: #!/bin/bash if [ $# -lt 2 ]; then echo "Usage: testssl.sh <host> ...


0

You can use more $ cat file | more $ ./program | more It displays the output from the beginning and you can go down by pressing spacebar or return keys until you want to get. press q to quit. Also you can use a different terminal as terminator and configure it to display "n" lines as you wish.


2

No. You can use lynx for this: lynx -dump URL UPDATE. Ops. Sorry. I did not see you know about lynx. I advice to use lynx for this purpose. It often produces very readable output. Sometimes you should use -width option to increase width of the output.



Top 50 recent answers are included