|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
If comparisons in ksh
I am converting a program from csh to ksh and having a lot of problems with the if statements.
here is the the basic program with the problem #!/bin/ksh # # set nohup set noclobber notify # tput clear echo " " echo -n "Enter Your CHOICE :" read CHOICE if (-n"$CHOICE") then echo "Choice is $CHOICE" fi when I run it a enter one as the choice I get the error Enter Your CHOICE : one ./vc_menu4[12]: -none: not found I have tried several variations to basically check if $CHOICE is null and then run the "then" clause. Can anyone help here. Thanks. |
|
#2
|
|||
|
|||
|
Code:
#!/bin/ksh
#
#
set nohup
set noclobber notify
#
clear
echo " "
echo "Enter Your CHOICE :\c"
read CHOICE
if [ -n "$CHOICE" ] ; then
echo "Choice is $CHOICE"
fi
exit 0
Several changes..... |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > If comparisons in ksh |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|