我如何在Cygwin中运行的bash shell脚本?

编程入门 行业动态 更新时间:2024-10-12 10:27:04
本文介绍了我如何在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脚本?

本文发布于:2023-11-23 19:10:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622566.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   如何在   bash   Cygwin   shell

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!