Linux-wget命令

Linux-wget command

我需要有关自定义 command in a 脚本的快速帮助:

wget 命令看起来像这样:

wget http://infamvn:8081/nexus/content/groups/LDM_REPO_LIN64/com/infa/com.infa. products.ldm.ingestion.server.scala/10.0.0.135.527-SNAPSHOT/com.infa.products.ldm.ingestion.server.scala-10.0.0.135.527-20150622.210643-1-sources.jar

这里我想在变量中添加 10.0.0.135.527,所以我创建了一个类似这样的脚本:

n = 10.0.0.135.527
wget http://infamvn:8081/nexus/content/groups/LDM_REPO_LIN64/com/infa/com.infa.products.ldm.ingestion.server.scala/"$n"-SNAPSHOT/com.infa.products.ldm.ingestion.server.scala-"$n"-20150622.210643-1-sources.jar

但这不起作用,知道这里出了什么问题吗?

尝试创建一个字符串变量 n,没有前导空格(感谢 @011c):

n="10.0.0.135.527"
wget http://infamvn:8081/nexus/content/groups/LDM_REPO_LIN64/com/infa/com.infa.products.ldm.ingestion.server.scala/"$n"-SNAPSHOT/com.infa.products.ldm.ingestion.server.scala-"$n"-20150622.210643-1-sources.jar