Scripting 在FreeBSD中运行脚本

Scripting 在FreeBSD中运行脚本,scripting,freebsd,Scripting,Freebsd,FreeBSD中的第一步:尝试运行我的安装脚本。需要快速帮助: # ls configure # file configure configure: Bourne-Again shell script text executable # ./configure ./configure: Command not found # configure configure: Command not found #ls 配置 #文件配置 配置:Bourne再次shell脚本文本可执行文件 #/配置 ./c

FreeBSD中的第一步:尝试运行我的安装脚本。需要快速帮助:

# ls configure # file configure configure: Bourne-Again shell script text executable # ./configure ./configure: Command not found # configure configure: Command not found #ls 配置 #文件配置 配置:Bourne再次shell脚本文本可执行文件 #/配置 ./configure:未找到命令 #配置 配置:未找到命令
出了什么问题,如何执行此脚本?

是否安装了bash?如果没有,请使用FreeBSD端口进行安装。使用
where bash
查找。

使用原力(卢克:)

可能是您的配置脚本没有适当的执行权限。试着投:

chmod 777 configure
如果有效,请将其修复到

chmod 764 configure

configure
脚本是超便携的shell脚本。这里不需要bash。问题出在别的地方

配置脚本的第一行是什么?可能是CR/LF潜入,这是一条完全误导性错误消息的常见原因,该消息称未找到脚本,而未找到的是解释器

请尝试
/bin/sh./configure

此脚本的第一行(
#!/usr/bin/bash
,我想)应更改为
#/usr/local/bin/bash

当然,您应该安装shell/bash端口。

使用

pkg add bash

默认情况下,FreeBSD附带tcsh和与POSIX兼容的FreeBSD sh

在旧的FreeBSD系统上,您需要执行以下操作

rehash

运行它之前。

配置的内容是什么??实际上,没有安装bash。我想我需要向超级用户询问细节。非常感谢。
make -C /usr/ports/shells/bash install clean
rehash