- 论坛徽章:
- 0
|
要求:Print the following user information: the home directory, mail directory, path, userid and login shell together with the current date and time.
提示:Script should list the specified environment variables. The current output of the date command, together with the userid and the full name of the user also needs to appear in this file, before the environment variables. The user’s full name must be obtained from the etc/passwd file and displayed as FAMILY NAME, followed by GIVEN NAME.
我写的:
- echo "$USERNAME's home directory: $HOME"
- echo "$USERNAME's mail directory: $MAIL"
- echo "$USERNAME's path: $PATH"
- echo -n "$USERNAME's userid:" ; grep $USERNAME /etc/passwd | awk -F: '{print $5)'
- echo "$USERNAME's login shell: $SHELL"
- echo -n "current date and time:" ; date
- ;;
复制代码
请问其中是不是有错误啊? |
|