bash - 我的 bash 脚本有什么问题,为什么它不起作用?
问题描述
#! bin/bash
echo "Hello what is your first name."
read name
if [ $name ]; then
echo "$name, that's a funny name"
else
echo "I asked for your name, you better answer me, i'll give you another chance, this time you better answer me, you understand, YES or NO"
read response
if [ $response ]; then
echo "Then tell me WHAT IS YOUR NAME"
read name
echo "Finally, thank you, bye $name"
else
echo "Say goodbye to your family"
fi
解决方案
问题似乎在你的第一线
改变
#! bin/bash
至
#!/bin/bash
推荐阅读
- android - FireTV:不支持视频、快进和快退的 Alexa 语音命令?
- unity3d - 操纵杆控制器适用于编辑器,但不适用于构建游戏
- node.js - 安装 composer-cli 时出错
- docker - 'docker build:版本固定如何使构建缓存失效?
- plot - 用圆点填充一个圆,使用对圆边缘的偏差
- spring - PropertySource 可选用变量命名的属性文件覆盖默认值
- crystal-lang - 如何将字符串数组的 JSON.mapping 配置为哈希?
- c# - C#反序列化字典包含正确的键但为空值
- git - 使用 Git 命名空间来托管多个存储库
- python - python GC - 引用计数仅在 gc.collect() 时有效?