Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. test $# = 0 && echo Usage: $0 {source file} {output directory} && exit 1
  2.  
  3. source_file=$1
  4. output_dir=$2
  5.  
  6. original_file='/tmp/original'
  7.  
  8. cp $source_file $original_file
  9.  
  10. while true; do
  11. link=`awk 'NR<2' $source_file`
  12. [[ -z $link ]] && break
  13. awk 'NR>1' $source_file > /tmp/file
  14. wget $link -P $output_dir
  15. cp /tmp/file $source_file
  16. done
  17.  
  18. cp $original_file $source_file
  19. echo all done && exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement