Download papers via SSH

by

Want to download a paper from home, or from a poor different university which doesn’t have all subscriptions? Try this paper-get script.

Usage: paper-get URL [filename]

#!/bin/sh

SSH_TARGET=user@mymachine

if [ -n "$2" ]; then
    DEST="$2"
else
    DEST="$(basename $1)"
    echo Saving to $DEST
fi

if [ -e "$DEST" ]; then
   echo Warning: the destination file already exists.
   echo Press Enter to overwrite, Ctrl-C to abort.
   read ANTANI
fi

ssh $SSH_TARGET wget -O- \"$1\" > "$DEST"
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: