However, back to the actual scripts.
toppicks1.sh:
Code:
workdir=/usr/script/scrapes
if [ ! -d "$workdir" ]; then
mkdir /usr/script/scrapes
fi
should really be:
Code:
workdir=/usr/script/scrapes
if [ ! -d "$workdir" ]; then
mkdir "$workdir"
fi
toppicks2.sh:
This uses let, which is a bash-only construct, so line one should be #!/bin/bash (in case that isn't a symlink to bash, which it isn't on Vix by default).
Code:
if [ $pick == 1 ]; then
should be
Code:
if [ $pick -eq 1 ]; then
since you are expecting it to be a number, not text.
Code:
if [ $pick == 1 ]; then
.
elif [ $pick == 2 ]; then
.
elif [ $pick == 3 ]; then
.
else
is better done as:
Code:
case $pick in
1)
.;;
2)
.;;
3)
.;;
*)
.;;
esac
both:
Code:
cd /usr/script/scrapes
should be:
Code:
cd /usr/script/scrapes || exit
or
Code:
if ! cd /usr/script/scrapes; then
echo >&2 "Failed to reach /usr/script/scrapes"
fi
since you shouldn't continue on an error.