Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- test $# = 0 && echo Usage: $0 {source file} {output directory} && exit 1
- source_file=$1
- output_dir=$2
- original_file='/tmp/original'
- cp $source_file $original_file
- while true; do
- link=`awk 'NR<2' $source_file`
- [[ -z $link ]] && break
- awk 'NR>1' $source_file > /tmp/file
- wget $link -P $output_dir
- cp /tmp/file $source_file
- done
- cp $original_file $source_file
- echo all done && exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement