大佬教程收集整理的这篇文章主要介绍了解析错误:shell 脚本中第 1 行第 7 列的数字文字无效,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用 curl 从 url 获取 Json 文件中的值,然后使用 jq 命令(例如端点)打印特定键。不幸的是,当我使用:jq 'def nvl(n): (n//[null])[];.paths | keys[] as $path | .[$path] | keys[] as $method | .[$method] | { $path,$methoD}'
时,我收到错误:解析错误:当我在 aws codeBuild 服务器上运行它时,第 1 行第 7 列的数字文字无效。
如果我在本地运行这个脚本,它运行良好
外壳脚本:
@H_404_8@#!/bin/bash
DEvendpoint=$1
contextpath=$2
APIgeePrefix=$3
APIgeeVersion=$4
Email=$5
BASE_PROXY_name=${Contextpath////_}
echo $BASE_PROXY_name
API_BASE_PATH=retirement
curl "${DEvendpoint}${Contextpath}/v2/API-docs" | jq 'def nvl(n): (n//[null])[];.paths | keys[] as $path | .[$path] | keys[] as $method | .[$method] | { $path,$methoD}' > APIendpoints.Json
jq -r '.path + " " + if .method == "get" then "INDV_GET" elif .method == "post" then "INDV_POST" else empty end' APIendpoints.Json | while read -r path method;
do
PROXY_name=${path////_}
echo ${APIgeePrefix}$BASE_PROXY_name$PROXY_name ${APIgeePrefix}$BASE_PROXY_name$PROXY_name $method $API_BASE_PATH$contextpath$path $contextpath$path $Email $APIgeeVersion
java -jar APIMakr.jar "." ${APIgeePrefix}$BASE_PROXY_name$PROXY_name ${APIgeePrefix}$BASE_PROXY_name$PROXY_name $method $API_BASE_PATH$contextpath$path $contextpath$path $Email $APIgeeVersion
done;
在本地运行时没有错误: 输出如下:
@H_404_8@$ ./generateAPI.sh https://ret-indv-dev.rde-nonprod.xxx.com /participant-plan/info Retirement v1 axxxx.kaxxxx@xxx.com
_participant-plan_info
% @R_755_10586@l % Received % Xferd Average Speed Time Time Time Current
Dload Upload @R_755_10586@l Spent left Speed
100 16262 100 16262 0 0 16262 0 0:00:01 --:--:-- 0:00:01 65048
Retirement_participant-plan_info_resetcache_secretmanager Retirement_participant-plan_info_resetcache_secretmanager INDV_GET retirement/participant-plan/info/resetcache/secretmanager /participant-plan/info/resetcache/secretmanager ankur.kashyap@prudential.com v1
APIgee proxy Bundle created and located at path = .\Project\Retirement_participant-plan_info_resetcache_secretmanager_rev1_2021_03_09\APIproxy
Steps to import Proxy in APIGEE::
在 AWS 服务器上通过 codeBuild 运行时: 输出:
@H_404_8@
[Container] 2021/03/09 06:22:05 Running command ./generateAPI.sh $DEvendpoint $COntexT_PATH Retirement v1 axxxx.kaxxxx@xxx.com
_participant-plan_info_
% @R_755_10586@l % Received % Xferd Average Speed Time Time Time Current
Dload Upload @R_755_10586@l Spent left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 134 100 134 0 0 10307 0 --:--:-- --:--:-- --:--:-- 10307
parse error: InvalID numeric literal at line 1,column 7
有什么建议吗?
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的解析错误:shell 脚本中第 1 行第 7 列的数字文字无效全部内容,希望文章能够帮你解决解析错误:shell 脚本中第 1 行第 7 列的数字文字无效所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。