找不到命令 -sh: shell 脚本错误
Command not found -sh: shell script error
我有一个 shell 脚本可以从输入文件的 header 中提取一个日期值,但是它失败了,出现命令未找到错误:
你能在这里指导我吗
#!/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 :
第Header_date = $(cut -c8-25 input.txt | head -1)
行=
前后不允许有空格
我有一个 shell 脚本可以从输入文件的 header 中提取一个日期值,但是它失败了,出现命令未找到错误: 你能在这里指导我吗
#!/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 :
第Header_date = $(cut -c8-25 input.txt | head -1)
行=
前后不允许有空格