[help] Bash Shell Script

DelarosaDelarosa Naturally Custom Join Date: 2002-11-29 Member: 10214Members, NS1 Playtester
<div class="IPBDescription"> - need help</div> here's the program...


echo " please enter number"
read num
echo " please enter number 2 "
read num2

hold=0

if [ $num -ge $num2 ]
then
$hold="$num"
else
$hold="$num2"

fi



------------------

now, i'm getting errors on the assignment lines, and for some reason, i can't see where i'm going wrong... any help is appreciated.

Comments

  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    edited November 2003
    ahh, the horror :O

    My syntax is crying! :O

    [edit]
    <span style='font-size:8pt;line-height:100%'>Not a bash (get it? HAR HAR HAR) on you, but rather the horrible horrible language. :P</span>
    [/edit]
  • JefeJefe Join Date: 2003-04-21 Member: 15734Members, Constellation
  • minskminsk Join Date: 2003-01-09 Member: 12077Members
    Need to yank the dollar signs on the left-hand side of the assignments. Any $variable will get replaced before bash tries to execute the script, so what is actually happening is the same as if you typed '0="42"' on the command line -- confusion
Sign In or Register to comment.