如何使用 BASH 脚本解析 CGI 脚本中的 POST 数据?

发布于 2024-08-26 02:17:44 字数 167 浏览 5 评论 0原文

我有一个用 bash 编写的 cgi 脚本,我必须读取发送到该文件的 POST 变量。 我不擅长 bash 脚本,所以我真的需要这个帮助。

我从 php 脚本发送一个名为 log_message 的 POST 变量到此 cgi,但我不知道如何从标头解析 POST var。

有什么帮助吗?

I Have a cgi script written with bash and i have to read a POST variable sent to this file.
I am not good at bash scripting so i really need this help.

From a php script I send a POST variable named log_message to this cgi but i don't know how to parse the POST var from the header.

Any help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧人九事 2024-09-02 02:17:44

这些 sed 都应该有一个 g,如下所示:

sed 's/whatever/whatever/**g**'

否则它会在第一次替换后停止,这通常不是所需的行为。

those seds should all have a g, as in:

sed 's/whatever/whatever/**g**'

otherwise it stops after the first replace, which is not generally the desired behaviour.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文