summaryrefslogtreecommitdiff
path: root/Shell
diff options
context:
space:
mode:
authorMinusGix <MinusGix@gmail.com>2019-09-09 16:48:04 -0500
committerAndreas Kling <awesomekling@gmail.com>2019-09-10 14:51:55 +0200
commit8920ece8f6cb1458295953cd74357c384ee145e1 (patch)
treeea0a088d43e307860eb99a88c068618480387122 /Shell
parent91a609d945456565304b62862946131dd0dba100 (diff)
downloadserenity-8920ece8f6cb1458295953cd74357c384ee145e1.zip
Shell: Add support for special parameter that returns PID
Diffstat (limited to 'Shell')
-rw-r--r--Shell/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Shell/main.cpp b/Shell/main.cpp
index 1ee0003b55..1891614a7f 100644
--- a/Shell/main.cpp
+++ b/Shell/main.cpp
@@ -309,6 +309,8 @@ static Vector<String> expand_parameters(const StringView& param)
String variable_name = String(param.substring_view(1, param.length() - 1));
if (variable_name == "?")
return { String::number(g.last_return_code) };
+ else if (variable_name == "$")
+ return { String::number(getpid()) };
char* env_value = getenv(variable_name.characters());
if (env_value == nullptr)