View Single Post
Old 1st November 2017
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 472
Default

Thanks Hanzer,
The first script you showed, was not close, and I couldn't make much sense of it,...
this second one, is very close to what I just now did, using this as a guide:
http://www.well.ox.ac.uk/~johnb/comp/unix/ksh.html
Code:
ls /home/garry/Images/backgrounds
print -n "Background file Name: "; read name; print ""
if [ $name = "" ];then
print "Your welcome, ${name}."
elif [ $name = "Hanna" ];then
print "Hello, ${name}, who are you?"
else
display  -window root /home/garry/Images/backgrounds/${name}
fi
Code:
$ input 
a-guako-background.jpg        a-openbsd-busy.gif            background-3.jpg
a-guako-background1.jpg       a-openbsd-notbusy.gif         background-4-plain.gif
a-guako-background2.jpg       b-background.jpg
a-guako-background3.jpg       background-2.jpg
Background file Name: b-background.jpg

$
Does what I want, how ever a really odd thing, or at least to me, these lines:
Code:
#print "Your welcome, ${name}."
#elif [ $name = "Hanna" ];then
#print "Hello, ${name}, who are you?"
#else
Don't appear to do anything, but when I removed them, it does not work. The background does not change when I paste in a different one.
I am going to try yours now.
thanks
=============edited====
Yours works perfect, and does not have any unneeded lines, thanks
__________________
My best friends are parrots

Last edited by PapaParrot; 1st November 2017 at 05:49 PM.
Reply With Quote