You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu终端批量执行astmkcatalog命令zeropoint参数异常求助

解决批量处理FITS文件时astmkcatalog命令参数读取异常问题

问题背景

我对Ubuntu终端操作不熟悉,需要批量处理多个.fits文件,每个文件对应zeropointsfile.txt中一行的zeropoint值,要执行的命令为:

astmkcatalog ${filename} --ids --ra --dec --magnitude --sn --zeropoint=${zeropoints} --brightness --clumpbrightness --brightnessnoriver --riverave --rivernum --clumpscat

编写Shell脚本用awk/sed读取对应行参数后,出现仅最后一个文件执行正常、重复运行脚本时命令混乱的问题,尝试多种参数读取方式都无法解决。

根因与解决方法

经过排查,发现问题出在**zeropointsfile.txt使用了DOS格式的换行符(\r\n)**,在Ubuntu的Shell环境中,\r会被当作参数的一部分,导致命令解析错误。

执行以下命令将文件转换为Unix格式换行符即可解决:

dos2unix zeropointsfile.txt

内容的提问来源于stack exchange,提问作者JPorron

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 22:33:13