我正在编写一个Perl脚本,该脚本将在与运行Linux的计算机联网的PC上运行。该脚本必须向Linux机器上的一组shell脚本提供输入,并从其中接收结果。我可以从PC复制输入文件,甚至可以调用Linux机器上的Perl脚本,但是当该脚本尝试通过以下方式运行.sh文件时:
system("./shell_script.sh");
它输出以下错误:
'.' is not recognized as an internal or external command, operable program or batch file.
我认为这意味着它试图在Window
我有一个模板文件(template.txt):
Hello, $x
Hello, $y
我有一个脚本文件(script.sh):
#!/bin/bash
$x=linux
$y=unix
# I want to include template.txt as a here-doc
如何将template.txt包含为here-doc of script.sh。
因此,当我运行script.sh时,输出应该是:
Hello, linux
Hello, unix
编辑:
我认为replace对我的工作来说是个很好的命令:
$ cat template.txt | replace '$x&
我在试着让电子文本编辑器运行。我还阅读了http://www.e-texteditor.com/forum/viewtopic.php?p=14953#14953,并在Linux上编译了电子文本编辑器。但是,在我的10.04清醒,它失败在以下步骤:
../build_linux.sh调试
具有下列错误消息:
Building debug binaries
Building 32-bit binaries
Going to place output in /opt/etexteditor/external/out.debug
./build_externals_linux.sh: line 41
我在前台运行了一个子进程,他的父亲已经离开了。
如果父进程已退出,则proc/$pid/stat文件不再包含父pid,并且它将显示1而不是原始父pid。
linux$cat /proc/6267/stat
6267 (test3.sh) S 1 6265 ......
# ^
# |
# I expected to get the origin parent pid but I get 1
要快速再现这种行为,我们可以使用以下脚本
test2.sh
#!/bin/sh
echo "test2=$$"
我在试着安装网络。6.3在我的chromebook上使用Linux,但当我试图执行
./dotnet-install.sh -c Current
在Linux终端中,总是会出现以下错误:
-bash: ./dotnet-install.sh: No such file or directory
有什么办法可以绕过它/解决它吗?
我已经完成了sudo -i,所以我获得了完全的许可,并且我已经将我要执行的文件放在很多文件夹中,包括我的Linux文件夹。
任何帮助都是非常感谢的!
我使用Android编译ffmpeg,当我运行config.sh时,发生了很多错误,如何解决它。
Terry-L@Terry-L-HP /cygdrive/e/Android/android-ndk-r8d/samples/FFmpeg/jni/ffmpeg
$ ./config.sh
Unknown option "".
See ./configure --help for available options.
./config.sh: line 6: --target-os=linux: command not found
./config.sh: line 7: --a
我在SunOS中以.sh文件的形式运行以下代码
#!/usr/bin/bash
#lerning linux scripting
#
printf "%-5s %-10s %-4s\n" No Name Mark
printf "%-5s %-10s %-4.2f\n" 1 James 80.1234
printf "%-5s %-10s %-4.2f\n" 2 Sarah 99.8923
但是,当我在中运行超过一个错误时,就会出现SunOS错误。
No Name Mark
: arithmetic syntax erro
我正在尝试为android构建FFmpeg,如下教程所示:
我在用:
NDK r10d
FFMPEG 2.5.4
我尝试在MacOs和Ubuntu上构建,当我执行./buildandroid.sh时会得到相同的错误:
`Creating config.mak, config.h, and doc/config.texi...
./build_android.sh: line 16: --prefix=/Users/jesusmartin92/Documents/android-ndk-r10d/sources/ffmpeg-2.5.4/android/arm: No such