HTTP_CODE= `echo "[{"key":"usernameError","message":"用户名错误"}] 422" | sed -En 's/^.* ([0-9]+)$/\1/p'`
echo "${HTTP_CODE}"
echo "[{"key":"usernameError","message":"用户名错误"}] 422" | sed -En 's/^.* ([0-9]+)$/\\1/p' return 422
but `to var` command not found
Remove the space after the =. I made a mistake
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.