我如何在Cygwin中运行的bash shell脚本? [英] How do I run bash shell scripts in cygwin?

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

问题描述

我有一个叫屠夫文件,并在该文件的顶部,我把#!/斌/ bash的。在我改变权限,像这样搭配chmod 777屠夫。但是当我尝试运行通过键入屠夫剧本,我得到这个错误:-bash:屠夫:命令未找到。我不知道如何解决它,请帮忙!先谢谢你! :D

I have a file called butcher and at the top of this file I put #!/bin/bash. The I changed permissions like so chmod 777 butcher. however when I try to run the script by typing butcher, I get this error: -bash: butcher: command not found. I'm not sure how to fix it, please help! Thank you in advance! :D

推荐答案

该文件将不得不在你的$ PATH为您的系统找到它,执行它。否则,该文件的整个路径必须被指定。

The file would have to be on your $PATH for your system to find it and execute it. Otherwise, the entire path to the file would have to be specified.

要显示你的路径尝试:

echo $PATH

屠夫位于

要运行脚本,无论是把它放在这些位置之一(例如/ usr / local / bin中),或转到该目录,运行 ./屠夫

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

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