robz0rz
November 11th, 2008, 02:54 PM
Hi all
I have never scirpted in bash, and I just hacked this little script together, but it's spiting out an error at me. Can someone please tell me how to fix it, and maybe how to improve it? Thanks already
#!/bin/bash
#function
function setdist {
cp .abyss/$1.svg scalable/places/start-here.svg
cp .abyss/$1.32.png 32x32/places/start-here.png
cp .abyss/$1.24.png 24x24/places/start-here.png
cp .abyss/$1.22.png 22x22/places/start-here.png
cp .abyss/$1.16.png 16x16/places/start-here.png
echo "You chose $1"
}
# command line args or chooser
if [ -n "$1" ]
then
distro=$1
else
select distro in "fedora" "generic" "gnome" "suse" "ubuntu"
fi
# change distro
case $distro in
"fedora") setdist "fedora";;
"generic") setdist "generic";;
"gnome") setdist "gnome";;
"suse") setdist "suse";;
"ubuntu") setdist "ubuntu";;
esac
exit
[rob@rob-thinkpad:~/.icons/Tangolicious$] ./changedist.sh
./changedist.sh: line 21: syntax error near unexpected token `fi'
./changedist.sh: line 21: `fi'
For those that don't get what this script is about - I'm throwing together my own icon theme, and this script should make it easier to change the affinity of the theme.
I have never scirpted in bash, and I just hacked this little script together, but it's spiting out an error at me. Can someone please tell me how to fix it, and maybe how to improve it? Thanks already
#!/bin/bash
#function
function setdist {
cp .abyss/$1.svg scalable/places/start-here.svg
cp .abyss/$1.32.png 32x32/places/start-here.png
cp .abyss/$1.24.png 24x24/places/start-here.png
cp .abyss/$1.22.png 22x22/places/start-here.png
cp .abyss/$1.16.png 16x16/places/start-here.png
echo "You chose $1"
}
# command line args or chooser
if [ -n "$1" ]
then
distro=$1
else
select distro in "fedora" "generic" "gnome" "suse" "ubuntu"
fi
# change distro
case $distro in
"fedora") setdist "fedora";;
"generic") setdist "generic";;
"gnome") setdist "gnome";;
"suse") setdist "suse";;
"ubuntu") setdist "ubuntu";;
esac
exit
[rob@rob-thinkpad:~/.icons/Tangolicious$] ./changedist.sh
./changedist.sh: line 21: syntax error near unexpected token `fi'
./changedist.sh: line 21: `fi'
For those that don't get what this script is about - I'm throwing together my own icon theme, and this script should make it easier to change the affinity of the theme.