Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Shell脚本未在ubuntu中运行_Python_Bash_Shell_Ubuntu_Libx265 - Fatal编程技术网

Python Shell脚本未在ubuntu中运行

Python Shell脚本未在ubuntu中运行,python,bash,shell,ubuntu,libx265,Python,Bash,Shell,Ubuntu,Libx265,我在bash脚本encode.sh中有以下脚本 echo "1 configuration out of 936" x265 incident_10d_384x288_25.yuv --input-res 384x288 --fps 25 str/incident_10d_384x288_25_QP_0_ON_B0.bin --tune psnr --psnr --preset medium --max-merge 5 --merange 64 --no-open-gop -I 48 -i 8

我在bash脚本
encode.sh
中有以下脚本

echo "1 configuration out of 936"
x265 incident_10d_384x288_25.yuv --input-res 384x288 --fps 25 str/incident_10d_384x288_25_QP_0_ON_B0.bin --tune psnr --psnr --preset medium --max-merge 5 --merange 64 --no-open-gop -I 48 -i 8 --tu-intra-depth 3 --tu-inter-depth 3 --input-depth 8 --aq-mode 0 --b-adapt 0 --scenecut 48 --ref 4 --sao --deblock=0:0 --bframes 0 --qp 0 --csv-log-level 2 --log-level 4 --csv csv/incident_10d_384x288_25_QP_0_ON_B0.csv > txt/1_incident_10d_384x288_25_QP_0_ON_B0.txt 2<&1 
echo "2 configuration out of 936"
x265 incident_10d_384x288_25.yuv --input-res 384x288 --fps 25 str/incident_10d_384x288_25_QP_1_ON_B0.bin --tune psnr --psnr --preset medium --max-merge 5 --merange 64 --no-open-gop -I 48 -i 8 --tu-intra-depth 3 --tu-inter-depth 3 --input-depth 8 --aq-mode 0 --b-adapt 0 --scenecut 48 --ref 4 --sao --deblock=0:0 --bframes 0 --qp 1 --csv-log-level 2 --log-level 4 --csv csv/incident_10d_384x288_25_QP_1_ON_B0.csv > txt/2_incident_10d_384x288_25_QP_1_ON_B0.txt 2<&1 
echo "3 configuration out of 936"
x265 incident_10d_384x288_25.yuv --input-res 384x288 --fps 25 str/incident_10d_384x288_25_QP_2_ON_B0.bin --tune psnr --psnr --preset medium --max-merge 5 --merange 64 --no-open-gop -I 48 -i 8 --tu-intra-depth 3 --tu-inter-depth 3 --input-depth 8 --aq-mode 0 --b-adapt 0 --scenecut 48 --ref 4 --sao --deblock=0:0 --bframes 0 --qp 2 --csv-log-level 2 --log-level 4 --csv csv/incident_10d_384x288_25_QP_2_ON_B0.csv > txt/3_incident_10d_384x288_25_QP_2_ON_B0.txt 2<&1 
我的shell脚本中有什么特殊的角色吗


您知道如何解决此问题吗?

输出重定向使用
&
,而不是
&1
1>&2

(可能是第一个,将标准错误(2)重定向到标准输出(1))

有关堆栈溢出的相关问题:


编辑:

显然,您也有其他顺序的错误消息:

[警告]:提供了额外未使用的命令参数>`

这更令人惊讶

根据我们在评论中的小讨论,这是由于不正确的行尾处理造成的。可能整个脚本只被视为一行大字,这可以解释bash对看到几个重定向感到惊讶


有关信息,如果删除了注释:使用记事本++菜单
Edit>EOL Conversion
解决了该问题。此处的更多信息:

我想您正在寻找
2>&1
,以将标准错误重定向到当前打开的标准输出。什么
2&2
,或将stderr重定向到stdout:
2>&1
谢谢!我还必须在
ubuntu
服务器的shell文件中复制和粘贴代码,而不仅仅是复制/粘贴它。可能windows中的某些特殊字符也是一个潜在问题。@zinon我不确定是否理解您的评论。这是你的另一个问题吗?在这种情况下,我建议打开一个带有特定细节的新问题。只有在windows中打开bash脚本,复制内容并在linux中的bash脚本文件中通过,您建议的解决方案才有效。如果我将bash脚本文件从windows拖放到linux,问题仍然存在。@zin完全是同一个问题吗?带有消息
[警告]:提供了额外的未使用的命令参数
转换为
的编码问题。你是对的<代码>编辑>下线转换
解决我的问题!
[warning]: extra unused command arguments given <