Platypus shell 脚本不提示输入 "read" 命令
Platypus shell script does not prompt for "read" command
我有一个这样的 shell 脚本:
#!/bin/sh
echo "What's your favorite color ?"
read user_color
echo "You like $user_color"
无论我对 Platypus 进行何种设置,执行时都不会显示提示,因此变量未定义且从不显示。这可能吗?
read
需要一个控制终端(或至少一个可用的标准输入),大概在您的环境中不存在这样的 terminal/input,因此 read
无法读取任何信息(并且 echo
没有标准输出可以发送数据,假设你也没有看到它)。
此限制在 platypus documentation and a workaround using CocoaDialog is given there as well。
我有一个这样的 shell 脚本:
#!/bin/sh
echo "What's your favorite color ?"
read user_color
echo "You like $user_color"
无论我对 Platypus 进行何种设置,执行时都不会显示提示,因此变量未定义且从不显示。这可能吗?
read
需要一个控制终端(或至少一个可用的标准输入),大概在您的环境中不存在这样的 terminal/input,因此 read
无法读取任何信息(并且 echo
没有标准输出可以发送数据,假设你也没有看到它)。
此限制在 platypus documentation and a workaround using CocoaDialog is given there as well。