使用Shell脚本将新用户添加到Fedora [英] Add New User to Fedora using Shell Script

查看:90
本文介绍了使用Shell脚本将新用户添加到Fedora的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好所有访客
我在将新用户添加到fedora core.5时遇到问题.
我想创建一个shell脚本,该脚本可以让用户向fedora输入新用户帐户.可以将新用户添加到fedora,但是我想考虑一下
当用户不输入任何文本时,它将让用户再次输入用户名.
我的意思是就像C或C ++中的goto标签一样,当用户不输入任何文本时,它将允许用户再次输入.
对于shell脚本,我如何创建像C或C ++这样的goto标签?
谢谢

Hi all visitors
i have problem with add new user to fedora core.5
i want to create one shell script that can let user to input new user account to fedora.it is ok for adding new user to fedora but i want to consider that
when the user doesn''t input any text, it will let user input user name again.
i mean it is like goto label in C or C++,when the user doesn''t input any text, it will let user input again.
for shell script how can i create goto label like C or C++?
Thanks

推荐答案

我写了shell脚本已经有一段时间了,但是也许是这样的:
It''s a while since I wrote shell scripts but maybe something like:
name=


1 同时 "
1 while "


名称" == " 回声" 读名字 完成
name"=="" do echo "Please enter your name" read name done


这篇关于使用Shell脚本将新用户添加到Fedora的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆