Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何访问 Vala 中的环境变量?(如上)看起来很简单,但我找不到 g_getenv() 是如何映射到 Vala 中的。
答案在于绑定文件。Vala 使用绑定(在 .vapi 文件中)将其构造绑定到 C 语言。在这种情况下,您可以通过 glib-2.0.vapi(在我的系统上/usr/share/vala-0.10/vapi)进行 grep,您会看到它被绑定为:
/usr/share/vala-0.10/vapi
unowned string? GLib.Environment.get_variable(string name)
掌握核心 VAPI 文件的位置可能非常有用,因为如果您知道函数的 C 名称,您只需 grep 即可。
我在通过 ssh2_exec 通过 php 传递以下命令时遇到问题,命令是
./prog cat <<EOF a a a b b c d d EOF
问题是第一行'cat <<EOF',php 将“EOF”作为一个特殊的词,我希望
'cat <<EOF'