11.04.2013 Views

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

done<br />

Appen<strong>di</strong>ce A. Script aggiuntivi<br />

if [ -z "${CookiesON}" ] && [ "$cFlag" = "1" ] ; then<br />

echo "Warning -- can’t find cookie file"<br />

# This should be changed, in case the user has opted to not use cookies.<br />

fi<br />

if [ "$Flag" = "S" ]; then<br />

echo "$WGETTER" >> $savePath/wget-${today}<br />

# Create a unique filename for today, or append to it if it exists.<br />

echo "$inputB" >> $savePath/site-list-${today}<br />

# Make a list, so it’s easy to refer back to,<br />

#+ since the whole command is a bit confusing to look at.<br />

echo "Command saved to the file $savePath/wget-${today}"<br />

# Tell the user.<br />

echo "Referring page URL saved to the file $savePath/site-list-${today}"<br />

# Tell the user.<br />

Saver=" with save option"<br />

# Stick this somewhere, so it appears in the loop if set.<br />

else<br />

echo "*****************"<br />

echo "*****Getting*****"<br />

echo "*****************"<br />

echo ""<br />

echo "$WGETTER"<br />

echo ""<br />

echo "*****************"<br />

eval "$WGETTER"<br />

fi<br />

exit 0<br />

echo ""<br />

echo "Starting over$Saver."<br />

echo "If you want to stop, press q."<br />

echo "Otherwise, enter some URL’s:"<br />

# Let them go again. Tell about save option being set.<br />

read<br />

case $REPLY in # Need to change this to a ’trap’ clause.<br />

q|Q ) exit $E_USER_EXIT;; # Exercise for the reader?<br />

* ) URLS=" $REPLY";;<br />

esac<br />

echo ""<br />

725

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!