bash shell脚本 [英] bash shell scripting

查看:106
本文介绍了bash shell脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,如果这篇文章相当长,但希望你不会感到无聊。我有一个项目在手,我已经开始并且截止日期为1周。基本上我需要做的是在Bash中为游戏Hangman创建一个shell脚本。我相信每个人都清楚这个游戏。不利的一面是我不能使用sed。或awk。 FUN FUN


我现在在我身边,而且truley完全失去了,所以任何帮助都会有很长的路要阻止我把我妻子的头发拉出来(我跑出去了很久以前我自己的头发:)


游戏必须有1个玩家或2个玩家的选项,需要在脚本运行时在开始时说明。这就是我为解决这个问题所采取的措施:

Sorry if this post is rather long but hopefully you wont get bored half way through. I have a project in hand which i have started and have a deadline of 1 week. Basically what i need to do is to create a shell script in Bash for the game Hangman. I am sure everyone is well aware of the game. The down side is that i can not use "sed" or "awk". FUN FUN

I am at my ends wit now and truley utterly lost, so any help would go a long way to stop my pulling my wife''s hair out ( i ran out of my own hair a long time ago :)

The game has to have the option for 1 player or 2 player, which needs to be stated at the started, when the script is run. This is what i have done to remedy this option:

展开 | 选择 | Wrap | 行号

推荐答案

展开 | 选择 | Wrap | 行号


我已将脚本拆开,弄清楚你做了什么。谢谢你。它帮助了我很多,让我更接近完成它。


我还有几个问题,我希望你或其他任何人都可以澄清。


1-用户输入为
I have pulled the script apart, figuring out what you have done. thank you for that. it has helped me alot and getting me closer towards getting it finished.

I had couple of more questions, which i was hoping you or anyone else can clarify.

1- the user input as


guess与

进行比较

这篇关于bash shell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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