我正在完成一项作业,但我似乎找不到任何有关如何完成它的“操作方法”示例。
我需要开发一个特定用途的命令 shell 来在至少有 2 个外部和内部命令的 Linux 系统上运行,例如 pwd、ifconfig。 shell 的目的是向 Linux 系统用户提供一组有限的功能。未指定语言。
我们之前没有获得任何可以使用的 Material ,所以我不知道如何做到这一点。任何帮助将不胜感激。
这是教授给出的“提示”:
"There are a number of different ways this assignment can be completed. Some can involve a combination of aliasing, shell scripts, using awk or modifying the tsh source."
请您参考如下方法:
使用此链接了解内部命令和外部命令之间的差异。 http://how-to.linuxcareer.com/internal-vs-external-linux-shell-commands
例如: 在~/.bashrc中
alias get_date "/tmp/script_1.sh"
alias current_date "/tmp/script_2.sh"
script_1.sh
time=$(current_date)
script_2.sh
date
并写入终端:
get_date