我有一個 shell 腳本可以從輸入檔案的標頭中提取日期值,但它失敗了,出現命令未找到錯誤:您能在此處指導我嗎
#!/bin/sh
if [ -f input.txt ]; then
echo "FILE exists."
Header_date = $(cut -c8-25 input.txt | head -1)
echo -e " header date value is : $Header_date"
else
echo "$FILE does not exist."
fi
錯誤:
FILE exists.
-sh: Header_date: command not found
header date value is :
uj5u.com熱心網友回復:
=在線前后Header_date = $(cut -c8-25 input.txt | head -1)不能有空格
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/461198.html
上一篇:使用xmllint在bash中決議具有多個屬性的XML
下一篇:SSH命令將輸出保存在特定目錄中
