Pacific-Design.com

    
Home Index

1. Bash

2. Read File

Bash / Read File /

Bash: Read URLs from file and save the HTML localy on the server.

#!/bin/bash
#----------------------------------------------------------------#
# Read URLs from data file and save them localy on the server
# Written by Kevin T. Duraj
#----------------------------------------------------------------#
i=1

cat "drugs.dat" | while read line; do 
  
    NAME=`echo $line |  awk -F "/" '{print $4}'` 
    echo $i " ... " $NAME
    lynx -source -dump $line | tee html/$NAME
    i=$(($i+1))
    sleep 1

done
#----------------------------------------------------------------#