如何将此命令作为别名或函数添加到我的 bash_profile 中?
curl -X GET -H "x-api-key:xxxxxxxxxxxxxx" -H "Content-Type: application/json" https://xxxxxxx.amazonaws.com/api/ | jq
我尝试过这个:
my-func () { curl -X GET -H "x-api-key:xxxxxxxxxxxxxx" -H "Content-Type: application/json" https://xxxxxxx.amazonaws.com/api/ | jq; }
当我尝试添加为别名或在函数中使用时出现以下错误。
-bash: `${
"message": "Missing Authentication Token"
}': not a valid identifier
答案1
编辑你的用户的“.bashrc”文件:
- root 用户的 /root/.bashrc
- 用户的 /home/user/.bashrc
其中有别名的例子:)