Shell Can';不要从脚本中调用脚本

Shell Can';不要从脚本中调用脚本,shell,path,stdin,library-path,Shell,Path,Stdin,Library Path,我正在尝试从另一个脚本中调用一个脚本。其思想是,程序应该接收作为stdin直接从unix邮件发送给它的电子邮件,然后解析一些内容并将其发送到新脚本 我很难理解新剧本。但是,此问题仅在脚本直接接受电子邮件时发生。如果我将一个文件放入其中,就不会有问题,它会找到新脚本 --------receiveEmail.sh---------- #!/bin/bash ###do some stuff to parse the stdin coming in and get variable $subject

我正在尝试从另一个脚本中调用一个脚本。其思想是,程序应该接收作为stdin直接从unix邮件发送给它的电子邮件,然后解析一些内容并将其发送到新脚本

我很难理解新剧本。但是,此问题仅在脚本直接接受电子邮件时发生。如果我将一个文件放入其中,就不会有问题,它会找到新脚本

--------receiveEmail.sh----------
#!/bin/bash
###do some stuff to parse the stdin coming in and get variable $subject and $body

issue=`. /home/dlaf/bin/makeissue.sh` ->>>> this is the line that doesn't seem to work when the input is straight from the email rather than from a txt file i send it.
IE:如果我有一个名为“
email.txt
”的测试文件,我执行以下命令:

cat email.txt | ./receiveEmail.sh
然后脚本调用工作正常

但是如果
receiveEmail.sh
直接接收电子邮件,它将无法调用新脚本。我知道这是它失败的地方,因为我得到了脚本一直工作到它试图调用新脚本的日志

--------receiveEmail.sh----------
#!/bin/bash
###do some stuff to parse the stdin coming in and get variable $subject and $body

issue=`. /home/dlaf/bin/makeissue.sh` ->>>> this is the line that doesn't seem to work when the input is straight from the email rather than from a txt file i send it.

我不明白为什么。我想可能是因为我错过了这条路的一部分?也许收到的邮件根本不知道我的完整路径是什么?但是我不确定,因为当我键入命令行
echo$LD\u LIBRARY\u PATH
时,我只得到一个空行,所以我假设它甚至没有设置,所以我不知道在使用Bash将输出保存到变量时,这怎么会是个问题,我通常会这样做


阅读问题<你怎么知道它不起作用?你在
makeissue.sh中做什么?试着用你的mAKEISSUE.SH中的一些
echo IM来调试它,而不是它的内容,看看你是否得到了输出。我有echo“IM IN mAKEISSUE.SH”,而且它永远都不会出现。你的程序不可能在正确调用它之前退出吗?(用于调试的
makeissue.sh中的
echo
makeissue.sh
)不要直接调用脚本(即在您的
receiveEmail.sh
中)。请尝试
/path/to/script
而不是
/path/to/script>。我在“问题”前面有一行echo行。所以没有理由退出。而且,当我手动发送文件时,它也会起作用,所以没有强制退出的内容
mapfile issue < <(~/bin/makeissue.sh)
echo "${issue[@]}"