2024-9-27 • linux bash shell shell-script 我目前正在尝试完成这个 shell 脚本,用于我班级的一个小项目。我不知道该如何解决这个问题。以下是提示和我目前所做的事情... 我目前所拥有的... #!/bin/bash if [ $1="-f" ] then Filename=$1 shift shift elif=[ $1="-a" ] then Adding=$1 shift then fi 答案1 最简单的方法是使用 getopts。 您可以在此处找到一个例子: 在 bash 中使用 getopts 的示例 干杯 相关内容 Dell Latitude 5590 - 如何使用中央按钮滚动 Nginx log_format 被忽略 苹果蓝牙键盘JKL显示123 可能仍不受支持。尝试 asn1parse。 电脑重启时显示“按 CTRL+ALT+DEL 解锁” Windows 7 是否使得在受限用户的桌面上升级下载的应用程序变得更容易? 如何在启动时禁用/断开 LAN 电缆 Windows Server 2008 的磁盘映像工具 如何在 Google Chrome 多功能框中禁用预览图像? Live USB 和 Windows - 使用 Chroot