#!/bin/bash
$activity1 = zenity --list --text " select the option" --radiolist --column "Select" --column "you are" FALSE "admin" TRUE "customer" ;
if [ $activity1 = "admin"]; then
( zenity --password --username );
else [ $activity1 = "customer" ]; then
( zenity --entry );\
--entry-text ""
fi
我收到错误“语法错误:”然后“意外(期待”fi“)” 任何人都可以给我答案吗?
答案 0 :(得分:1)
不应该有其他条件。
你应该有
if [ $activity1 = "admin"]; then
( zenity --password --username );
else # no condition
zenity --entry );\
--entry-text ""
fi
或使用elif
if [ $activity1 = "admin"]; then
( zenity --password --username );
elif [ $activity1 = "customer" ]; then
( zenity --entry );\
--entry-text ""
fi