是PYTHON替换Linux Shell吗?它是一种SHell语言吗? [英] IS PYTHON a Replacement for a Linux Shell? Is it a SHell language?

查看:120
本文介绍了是PYTHON替换Linux Shell吗?它是一种SHell语言吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到的答案很复杂,Python是shell还是不是? Python似乎比Bash更容易理解,但Bash是Linux的Shell。



我正在写一篇关于Linux Shell的文章,我对这一点很困惑。我很快就需要答案。在此先感谢您的帮助。

I'm getting mixed answers, is Python a shell or isn't it? Python seems easier to understand than Bash but Bash is a "Shell" for Linux.

I'm writing a paper about Linux Shells and am confused on this point. I need an answer rather quickly please. Thanks in advance for any help.

推荐答案

Python是一种编程语言: http://en.wikipedia.org/wiki/Python_%28programming_language%29 [ ^ ]



但是它可以在shell中使用。
Python is a programming language : http://en.wikipedia.org/wiki/Python_%28programming_language%29[^]

However it can be used within a shell.


正如Mehdi Gholam所说,它是一种编程语言,它可以用作shell,但它本身非常不方便。它可以是一个shell,因为它有一个交互式界面,但它很不方便,因为你通常在shell中使用的主shell命令是方法调用,它不会让你轻易使用管道和其他与进程相关的东西,并且因为语法语言不足以编写简短命令。

但还有另一个方面:你可以有效地使用它作为shell脚本语言,因为你不需要为命令使用相同的shell行和脚本。举几个例子: http://www.linuxjournal.com/content/python-scripts- replacement-bash-utility-scripts [ ^ ], http://www.jperla.com/ blog / post / a-clean-python-shell-script [ ^ ]
As Mehdi Gholam stated, it is a programming language and it can be used as shell, but it is quite inconvenient as such. It can be a shell because it has an interactive interface, but it is inconvenient because the main shell commands you normally use in a shell are method calls, it won't let you use pipes and other process related things easily, and because the syntax of the language is not adequate for writing short commands.
But there is an other aspect: you can use it efficiently as shell script language, as you don't need to use the same shell for the command line and for scripting. Just some examples: http://www.linuxjournal.com/content/python-scripts-replacement-bash-utility-scripts[^], http://www.jperla.com/blog/post/a-clean-python-shell-script[^]


Python不是shell。它是编程语言。您可以使用此编程语言编写许多漏洞利用程序。因此,将在远程计算机上产生控制的漏洞也被称为SHELLS。像这样你可以使用perl,ruby,php编程漏洞利用编程语言...即使漏洞被称为SHELLS,它也不是原始的shell。在Linux中,shell是Bourne Shell(sh),Bash,C Shell(csh),K Shell(ksh)等。



另请注意,python的命令行解释器(打开终端/命令提示符和运行命令python,你可以看到运行python命令/代码的python shell)也称为Python Shell。
Python is not a shell. It is programming language. You can program many exploits using this programming language. So, the exploits that will spawn control over remote computers are also called as "SHELLS". Like this you can program exploits using perl, ruby, php like programming languages... Even if the exploits are called as "SHELLS", it is not original shell. In Linux the shells are "Bourne Shell(sh), Bash, C Shell(csh), K Shell(ksh), etc".

Also note it, python's commandline interpreter(open terminal/command prompt and run command "python", you can see python shell to run python commands/codes) is also known as "Python Shell".


这篇关于是PYTHON替换Linux Shell吗?它是一种SHell语言吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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