简体   繁体   English

在Windows环境下学习UNIX Bash / Shell脚本

[英]Learning UNIX Bash/Shell scripting on a windows enviornment

I was just curious if there are any tools out there that would allow me to practice shell scripting without dual booting my computer to half windows and half UNIX. 我只是好奇是否有任何工具可以让我练习shell脚本,而无需将计算机双启动到一半窗口和一半UNIX。 I've heard of Cygwin but is that truly UNIX ? 我听说过Cygwin,但这是真正的UNIX吗?

Install Cygwin or install a Linux system under a virtual machine with emulators like VirtualBox . 在具有诸如VirtualBox之类的模拟器的虚拟机下安装Cygwin或安装Linux系统。

Cygwin is not completely UNIX but it would be enough with not-too-system related scripting. Cygwin并不完全是UNIX,但是使用与系统无关的脚本就足够了。 There are differences though compared to a true UNIX system eg process managing wouldn't really work well. 但是,与真正的UNIX系统相比,存在一些差异,例如,进程管理实际上并不能很好地工作。 /proc too I think doesn't work as expected. / proc我也认为无法正常工作。

Cygwin可以,但是请记住,如果您想了解UNIX,Cygwin将无助于学习Linux文件系统,这一点很重要。

You could also have a look at How to develop in Linux-Like Shell (bash) on Windows? 您也可以看看如何在Windows上的类似Linux的Shell(bash)中进行开发? , maybe there are some helpful answers. ,也许有一些有用的答案。

Personally, I think a Linux VM is your best option. 就个人而言,我认为Linux VM是您的最佳选择。 Cygwin is a UNIX-like environment on top of Windows, it's not a UNIX emulator. Cygwin是Windows之上的类似UNIX的环境,它不是UNIX仿真器。

I generally install git with Windows installer. 我通常使用Windows安装程序安装git Not only it comes with bash (look for "git bash" in Start menu), it also comes with git (duh) and ssh . 它不仅带有bash(在“开始”菜单中查找“ git bash”),还带有git (duh)和ssh

Obviously that's not "truly unix", for that install Virtualbox and in it FreeBSD or some other *BSD (they are officially "unix", unlike Linux which is "just" unix-like). 显然,这不是“真正的unix”,对于安装Virtualbox以及其中的FreeBSD或其他* BSD(它们是正式的“ unix”,不像Linux一样,只是“ unix”样)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM