gpt4 book ai didi

linux - shell 脚本错误

转载 作者:太空宇宙 更新时间:2023-11-04 11:28:17 25 4
gpt4 key购买 nike

<分区>

我有这个 shell 脚本,但我不断收到奇怪的错误。其中之一需要做。另一个是找不到 config.txt,但我在 .sh 脚本的目录中有它。

这是错误打印输出:

jmgreen@jdev:~/citigetbash$ sh citiget.sh
: not found 2: clear
CITIGET
config.txt: No such file or directory

citiget.sh: 17: Syntax error: word unexpected (expecting "do")

这是目录的LS:

jmgreen@jdev:~/citigetbash$ ls
citiget.sh config.txt docs

这是我的shell脚本

#!/bin/bash
clear
strTitle="CITIGET"
echo $strTitle
#=====CONFIGURATION=============================================================
strLocalDir="/home/jmgreen/citigetbash/"
intMode=1
intTry=5
#===============================================================================
#
# ===== Read in all the URLs
strDir=$(pwd)
URLS=$(cat $strLocalDir"config.txt")
echo $URLS
# ===== Get the file
if [ $intMode = 1 ]; then
for u in $URLS;
do
# ===== Get the datestamp ready
ts=$(date +%Y%m%d%H%M%S);
echo "Trying..."$u
wget $u --no-check-certificate -t$intTry -a logfile.txt -O $strLocalDir"downloaded/"$ts".csv";
done
else
for u in $URLS;
do
# ===== Get the datestamp ready
ts=$(date +%Y%m%d%H%M%S);
wget $u -q --no-check-certificate -t$intTry -a logfile.txt -O $strLocalDir"downloaded/"$ts".csv";
done
fi
# ===== Clear Screen?
if [ $intMode = 1 ]; then
clear
fi
echo "===== DONE ====="
exit

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com